Changeset 1839


Ignore:
Timestamp:
04/03/12 07:35:02 (12 years ago)
Author:
twagoo
Message:

'Save' button is disabled except when editing existing components/profiles from workspace. Fixes #165

Location:
ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/editor
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/editor/CMDComponentXMLEditor.as

    r1816 r1839  
    175175                                cmdSpec = CMDSpec.createEmptyProfile();
    176176                        }
     177                        dispatchEditorChangeEvent();
    177178                }
    178179
  • ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/editor/Editor.mxml

    r1733 r1839  
    1616               
    1717                <mx:VBox width="100%" minHeight="30">
    18                         <editor:EditorButtonBar width="100%"
     18                        <editor:EditorButtonBar id="buttonBar"
     19                                                                        width="100%"
    1920                                                                        height="25"
    2021                                                                        saveClick="saveSpec(true, UploadService.UPDATE)"
  • ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/editor/EditorAS.as

    r1733 r1839  
    5353}
    5454
     55private function determineSaveButtonEnabled():void {
     56        buttonBar.saveBtn.enabled = (itemDescription != null && itemDescription.isInUserSpace && null != itemDescription.id && null != xmlEditor.cmdSpec.headerId);
     57}
     58
    5559private function profileLoaded(event:Event):void {
    5660        var cmdComponent:XML = profileSrv.profile.profileSource;
    5761        this.cmdSpec = CMDModelFactory.createModel(cmdComponent, profileSrv.profile.description);
     62        determineSaveButtonEnabled();
    5863        CursorManager.removeBusyCursor();
    5964}
     
    6267        var cmdComponent:XML = componentSrv.component.componentMD.xml;
    6368        this.cmdSpec = CMDModelFactory.createModel(cmdComponent, componentSrv.component.description);
     69        determineSaveButtonEnabled();
    6470        CursorManager.removeBusyCursor();
    6571}
     
    7581                        componentSrv.load(itemDescription);
    7682                }
     83                buttonBar.saveBtn.enabled = false;
    7784        }
    7885}
     
    153160        uploadProgress.visible = false;
    154161        uploadProgress.includeInLayout = false;
     162        determineSaveButtonEnabled();
    155163}
    156164
  • ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/editor/EditorButtonBar.mxml

    r835 r1839  
    1111        <mx:Button id="saveBtn"
    1212                           label="save"
    13                            click="dispatchEvent(new MouseEvent('saveClick'))"/>
     13                           click="dispatchEvent(new MouseEvent('saveClick'))"
     14                           enabled="false"
     15                           />
    1416        <mx:Button id="saveAsNewBtn"
    1517                           label="save as new"
Note: See TracChangeset for help on using the changeset viewer.