Ignore:
Timestamp:
2013-03-07T10:01:15+13:00 (11 years ago)
Author:
sjm84
Message:

Adding a recycle bin icon that changes if there has been an element removed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/web/interfaces/default/js/debug_scripts.js

    r27013 r27015  
    3838    var _styleFunctions = new Array();
    3939   
    40     var partialPageReload = function()
     40    var partialPageReload = function(callback)
    4141    {
    4242        $.ajax(document.URL)
     
    7070            alert("There was an error reloading the page, please reload manually.");
    7171        });
     72       
     73        if(callback)
     74        {
     75            callback();
     76        }
    7277    }
    7378   
     
    166171                if(_isVisualEditor)
    167172                {
     173                    _vEditor.savePendingEdits();
    168174                    xmlString = new XMLSerializer().serializeToString(_vEditor.getXML());
    169175                }
     
    190196                if(_currentMatch && _currentMatch.length > 0){parameters["s1.match"] = _currentMatch;}
    191197
    192                 _saveButton.button("option", "label", "Saving...");
    193198                _saveButton.button("option", "disabled", true);
     199                $.blockUI({message:'<div class="ui-state-active">Saving, please wait...</div>'});
    194200
    195201                $.post(url, parameters)
     
    199205                    .success(function()
    200206                    {
    201                         alert("The template has been saved successfully.");
     207                        partialPageReload(function(){$.unblockUI();});
    202208                    })
    203209                    .error(function()
    204210                    {
     211                        $.unblockUI();
    205212                        alert("Error reloading collection.");
    206213                    })
    207214                    .complete(function()
    208215                    {
    209                         _saveButton.button("option", "label", "Save changes");
    210216                        _saveButton.button("option", "disabled", false);
    211                         partialPageReload();
    212217                    });
    213218                })
     
    227232                if(_isVisualEditor)
    228233                {
     234                    _vEditor.savePendingEdits();
    229235                    _vEditor.getMainDiv().hide();
    230236                    var containerNode = _vEditor.getXML().firstChild;
Note: See TracChangeset for help on using the changeset viewer.