Changeset 2080


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

Added cancel button to editor

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

Legend:

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

    r1988 r2080  
    88                   label="Editor"
    99                   creationComplete="init()"
    10                    implements="clarin.cmdi.componentregistry.common.components.RegistryView"
     10                   implements="clarin.cmdi.componentregistry.common.components.RegistryView" xmlns:components="clarin.cmdi.componentregistry.common.components.*"
    1111                   >
    1212       
     
    2121                                                                        saveClick="saveSpec(true, UploadService.UPDATE)"
    2222                                                                        saveAsNewClick="saveSpec(true, UploadService.NEW)"
    23                                                                         publishClick="publishSpec()"/>
     23                                                                        publishClick="publishSpec()"
     24                                                                        cancelClick="cancel()"
     25                                                                        />
    2426                        <mx:Text id="errorMessageField"
    2527                                         text="{uploadService.message}"
  • 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.
  • ComponentRegistry/branches/ComponentRegistry-1.12.0/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/editor/EditorButtonBar.mxml

    r1988 r2080  
    88                [Event(name="saveAsNewClick", type="flash.events.MouseEvent")]
    99                [Event(name="publishClick", type="flash.events.MouseEvent")]
     10                [Event(name="cancelClick", type="flash.events.MouseEvent")]
    1011        </mx:Metadata>
    1112        <mx:Button id="saveBtn"
    12                            label="save"
     13                           label="Save"
    1314                           click="dispatchEvent(new MouseEvent('saveClick'))"
    1415                           enabled="false"
    1516                           />
    1617        <mx:Button id="saveAsNewBtn"
    17                            label="save as new"
     18                           label="Save as new"
    1819                           click="dispatchEvent(new MouseEvent('saveAsNewClick'))"/>
    1920        <mx:Button id="publishBtn"
    20                            label="publish in public space"
     21                           label="Publish in public space"
    2122                           click="dispatchEvent(new MouseEvent('publishClick'))"/>
     23       
     24        <mx:Button id="cancelBtn"
     25                           label="Cancel"
     26                           click="dispatchEvent(new MouseEvent('cancelClick'))"/>
    2227</mx:HBox>
Note: See TracChangeset for help on using the changeset viewer.