- Timestamp:
- 2013-03-07T10:01:15+13:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/web/interfaces/default/js/debug_scripts.js
r27013 r27015 38 38 var _styleFunctions = new Array(); 39 39 40 var partialPageReload = function( )40 var partialPageReload = function(callback) 41 41 { 42 42 $.ajax(document.URL) … … 70 70 alert("There was an error reloading the page, please reload manually."); 71 71 }); 72 73 if(callback) 74 { 75 callback(); 76 } 72 77 } 73 78 … … 166 171 if(_isVisualEditor) 167 172 { 173 _vEditor.savePendingEdits(); 168 174 xmlString = new XMLSerializer().serializeToString(_vEditor.getXML()); 169 175 } … … 190 196 if(_currentMatch && _currentMatch.length > 0){parameters["s1.match"] = _currentMatch;} 191 197 192 _saveButton.button("option", "label", "Saving...");193 198 _saveButton.button("option", "disabled", true); 199 $.blockUI({message:'<div class="ui-state-active">Saving, please wait...</div>'}); 194 200 195 201 $.post(url, parameters) … … 199 205 .success(function() 200 206 { 201 alert("The template has been saved successfully.");207 partialPageReload(function(){$.unblockUI();}); 202 208 }) 203 209 .error(function() 204 210 { 211 $.unblockUI(); 205 212 alert("Error reloading collection."); 206 213 }) 207 214 .complete(function() 208 215 { 209 _saveButton.button("option", "label", "Save changes");210 216 _saveButton.button("option", "disabled", false); 211 partialPageReload();212 217 }); 213 218 }) … … 227 232 if(_isVisualEditor) 228 233 { 234 _vEditor.savePendingEdits(); 229 235 _vEditor.getMainDiv().hide(); 230 236 var containerNode = _vEditor.getXML().firstChild;
Note:
See TracChangeset
for help on using the changeset viewer.