Changeset 2082


Ignore:
Timestamp:
08/14/12 13:26:16 (12 years ago)
Author:
twagoo
Message:

Checking for pending changes not when switching to editor but when cancelling editing

Location:
ComponentRegistry/branches/ComponentRegistry-1.12.0/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ComponentRegistry/branches/ComponentRegistry-1.12.0/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/common/components/RegistryViewStack.as

    r1988 r2082  
    7878               
    7979                public function switchToEditor(itemDescription:ItemDescription):void {
    80                         // About to open item in editor, check if there are pending changes
    81                         if(itemDescription != null && editor.xmlEditor.specHasChanges){
    82                                 Alert.show("Doing this will discard all changes in the component that is currently being edited. Proceed?", "Discard changes", Alert.OK|Alert.CANCEL, this,
    83                                         function(event:CloseEvent):void {
    84                                                 if(event.detail == Alert.OK) {
    85                                                         doSwitchToEditor(itemDescription);
    86                                                 }
    87                                         } );
    88                         } else {
    89                                 doSwitchToEditor(itemDescription);
    90                         }
     80                        doSwitchToEditor(itemDescription);
    9181                }
    9282               
  • ComponentRegistry/branches/ComponentRegistry-1.12.0/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/editor/EditorAS.as

    r2080 r2082  
    136136
    137137private function cancel():void {
    138         Alert.show("Are you sure you want to cancel editing?", "Cancel editing", Alert.YES|Alert.NO, null,
     138        if(xmlEditor.specHasChanges){
     139        Alert.show("There are pending changes. Cancelling will discard these. Are you sure you want to proceed?", "Discard changes?", Alert.YES|Alert.NO, null,
    139140                function (eventObj:CloseEvent):void{
    140141                        if(eventObj.detail == Alert.YES){
     
    142143                        }
    143144                });
     145        } else {
     146                viewStack.switchToBrowse(itemDescription);
     147        }
    144148}
    145149
Note: See TracChangeset for help on using the changeset viewer.