//>>built
require({cache:{"url:app/ui/dialogs/templates/ConceptEditDialog.html":'\x3cdiv\x3e\n  \x3cdiv class\x3d"large-12 columns"\x3e\n    \x3cdiv class\x3d"large-4 columns"\x3e\n      \x3cdiv class\x3d"placeholder-container"\x3e\n        \x3clabel\x3eSCHEME\x3c/label\x3e\n        \x3cinput type\x3d"text" data-dojo-attach-point\x3d"schemeNode" disabled /\x3e\n      \x3c/div\x3e\n    \x3c/div\x3e\n    \x3cdiv class\x3d"large-4 columns"\x3e\n      \x3cdiv class\x3d"placeholder-container"\x3e\n        \x3clabel\x3eTYPE\x3c/label\x3e\n        \x3cselect data-dojo-attach-point\x3d"typeNode"\x3e\x3c/select\x3e\n      \x3c/div\x3e\n    \x3c/div\x3e\n  \x3c/div\x3e\n  \x3chr class\x3d"concept-hr"\x3e\n  \x3cdiv class\x3d"large-12 columns" style\x3d"padding-bottom: 20px;"\x3e\n    \x3cdiv data-dojo-type\x3d"dijit/layout/TabContainer"\n         data-dojo-attach-point\x3d"tabContainer"\n         data-dojo-props\x3d"doLayout:false"\n         class\x3d""\x3e\n\n      \x3cdiv data-dojo-type\x3d"dijit/layout/ContentPane"\n           title\x3d"Labels"\n           data-dojo-attach-point\x3d"tabLabels"\n           data-dojo-props\x3d"selected:true"\x3e\n        \x3cdiv data-dojo-attach-point\x3d"labelsNode"\x3e[ LABELS ]\x3c/div\x3e\n      \x3c/div\x3e\n\n      \x3cdiv data-dojo-type\x3d"dijit/layout/ContentPane"\n           title\x3d"Notes"\n           data-dojo-attach-point\x3d"tabNotes"\x3e\n        \x3cdiv data-dojo-attach-point\x3d"notesNode"\x3e[ NOTES ]\x3c/div\x3e\n      \x3c/div\x3e\n      \x3cdiv data-dojo-type\x3d"dijit/layout/ContentPane"\n           title\x3d"Relations"\n           data-dojo-attach-point\x3d"tabRelations"\n           style\x3d"max-height: 408px; overflow-y: auto;"\x3e\n        \x3cdiv data-dojo-attach-point\x3d"relationsNode"\x3e[ RELATIONS ]\x3c/div\x3e\n      \x3c/div\x3e\n      \x3cdiv data-dojo-type\x3d"dijit/layout/ContentPane"\n           title\x3d"Matches"\n           data-dojo-attach-point\x3d"tabMatches"\n           style\x3d"max-height: 408px; overflow-y: auto;"\x3e\n        \x3cdiv data-dojo-attach-point\x3d"matchesNode"\x3e[ MATCHES ]\x3c/div\x3e\n      \x3c/div\x3e\n    \x3c/div\x3e\n  \x3c/div\x3e\n  \x3cdiv class\x3d"large-12 columns text-center" style\x3d"margin-top: 30px; margin-bottom: 20px;"\x3e\n    \x3ca href\x3d"#" class\x3d"button tiny" data-dojo-attach-event\x3d"onClick: _saveConcept"\x3eSave\x3c/a\x3e\n    \x3ca href\x3d"#" class\x3d"button tiny" data-dojo-attach-event\x3d"onClick: _cancel"\x3eCancel\x3c/a\x3e\n  \x3c/div\x3e\n\x3c/div\x3e'}});
define("app/ui/dialogs/ConceptEditDialog","dojo/_base/declare dojo/_base/lang dojo/topic dojo/on dijit/Dialog dijit/_Widget dijit/_TemplatedMixin dijit/_WidgetsInTemplateMixin ../../utils/DomUtils ../managers/LabelManager ../managers/NoteManager ../managers/RelationManager ../managers/MatchesManager ../../utils/DomUtils dojo/text!./templates/ConceptEditDialog.html dijit/layout/TabContainer dijit/layout/ContentPane".split(" "),function(d,c,t,e,f,g,h,k,u,l,m,n,p,q,r){return d([g,h,k],{templateString:r,
baseClass:"concept-edit-dialog",concept:null,dialog:null,parent:null,scheme:null,languageController:null,listController:null,conceptSchemeController:null,postCreate:function(){this.inherited(arguments);this.dialog=new f({title:"Edit \x3cstrong\x3e"+this.concept.label+"\x3c/strong\x3e",style:"width: 1000px; min-height: 700px;",onHide:c.hitch(this,function(){this.parent._closeEditDialog()})});this.dialog.closeText.innerHTML='\x3ci class\x3d"fa fa-times"\x3e\x3c/i\x3e';this.dialog.set("content",this);
q.addOptionsToSelect(this.typeNode,{data:this.listController.getConceptTypes(),idProperty:"value",labelProperty:"label"});e(this.typeNode,"change",c.hitch(this,function(a){this._toggleMatches(a.target.value);this._toggleRelations(a.target.value)}));this._createLabelsTab(this.concept);this._createNotesTab(this.concept);this._createRelationsTab(this.concept);this._createMatchesTab(this.concept)},startup:function(){this.inherited(arguments);this.concept&&this._setData(this.concept);this.showDialog();
this.tabContainer.layout();this.dialog.resize()},_setData:function(a){this.schemeNode.value=this.scheme;this.typeNode.value=this.concept.type;this._toggleMatches(this.concept.type)},showDialog:function(){this.tabContainer.layout();this.dialog.show();this.dialog.resize()},_toggleMatches:function(a){"collection"===a?(this.tabMatches.set("disabled",!0),this.tabContainer.selectedChildWidget===this.tabMatches&&this.tabContainer.selectChild(this.tabLabels)):this.tabMatches.set("disabled",!1)},_toggleRelations:function(a){"collection"===
a?this.relationManager.setCollectionTypes():this.relationManager.setConceptTypes()},_close:function(){this.dialog.hide()},_saveConcept:function(a){a?a.preventDefault():null;a={};this.concept&&(a.id=this.concept.id,a.uri=this.concept.uri,a.concept_scheme=this.scheme);a.type=this.typeNode.value;var b=this.labelManager.getData();c.mixin(a,b);b=this.noteManager.getData();c.mixin(a,b);b=this.relationManager.getData();c.mixin(a,b);"collection"!==a.type&&(b=this.matchesManager.getData(),c.mixin(a,b));this.emit("concept.save",
{concept:a,schemeId:this.scheme})},_cancel:function(a){a?a.preventDefault():null;this.parent._closeEditDialog()},_createLabelsTab:function(a){this.languageController.getLanguageStore().fetch().then(c.hitch(this,function(b){this.labelManager=new l({languageController:this.languageController,listController:this.listController,concept:a,languageList:b},this.labelsNode);this.labelManager.startup()}))},_createNotesTab:function(a){this.languageController.getLanguageStore().fetch().then(c.hitch(this,function(b){this.noteManager=
new m({languageController:this.languageController,listController:this.listController,concept:a,languageList:b},this.notesNode);this.noteManager.startup()}))},_createRelationsTab:function(a){this.languageController.getLanguageStore().fetch().then(c.hitch(this,function(b){this.relationManager=new n({languageController:this.languageController,listController:this.listController,conceptSchemeController:this.conceptSchemeController,concept:a,languageList:b,scheme:this.scheme},this.relationsNode);this.relationManager.startup()}))},
_createMatchesTab:function(a){this.languageController.getLanguageStore().fetch().then(c.hitch(this,function(b){this.matchesManager=new p({languageController:this.languageController,listController:this.listController,conceptSchemeController:this.conceptSchemeController,concept:a,languageList:b,scheme:this.scheme,matchTypes:this.listController.getMatchTypes()},this.matchesNode);this.matchesManager.startup()}))}})});
//# sourceMappingURL=ConceptEditDialog.js.map