Ignore:
Timestamp:
08/14/12 13:20:19 (12 years ago)
Author:
twagoo
Message:

Added cancel button to editor

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ComponentRegistry/branches/ComponentRegistry-1.12.0/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/editor/EditorAS.as

    r1988 r2080  
    22import clarin.cmdi.componentregistry.browser.BrowserColumns;
    33import clarin.cmdi.componentregistry.common.ItemDescription;
     4import clarin.cmdi.componentregistry.common.components.RegistryViewStack;
    45import clarin.cmdi.componentregistry.editor.model.CMDModelFactory;
    56import clarin.cmdi.componentregistry.editor.model.CMDSpec;
     
    3940private var uploadService:UploadService = new UploadService();
    4041
     42[Bindable]
     43private var viewStack:RegistryViewStack;
    4144
    4245public function init():void {
     
    4750        uploadService.init(uploadProgress);
    4851        Config.instance.addEventListener(Config.USER_SPACE_TOGGLE_EVENT, toggleUserSpace);
     52        viewStack = this.parent as RegistryViewStack;
    4953}
    5054
     
    131135}
    132136
     137private function cancel():void {
     138        Alert.show("Are you sure you want to cancel editing?", "Cancel editing", Alert.YES|Alert.NO, null,
     139                function (eventObj:CloseEvent):void{
     140                        if(eventObj.detail == Alert.YES){
     141                                viewStack.switchToBrowse(itemDescription);                             
     142                        }
     143                });
     144}
     145
    133146/**
    134147 * Calls usage check for the specified component. If in use, asks user whether to proceed; if positive, initiates update.
Note: See TracChangeset for help on using the changeset viewer.