Skip to content

Instantly share code, notes, and snippets.

@lordbron
Last active December 25, 2015 05:19
Show Gist options
  • Save lordbron/6923497 to your computer and use it in GitHub Desktop.
Save lordbron/6923497 to your computer and use it in GitHub Desktop.
the binding in serialization
Serialization in parent component:
"pagePanel": {
"prototype": "montage/ui/repetition.reel",
"properties": {
"element": {
"#": "pagePanel"
},
"isSelectionEnabled": false,
"contentController": {"@": "panelItems"},
"axis": "vertical"
},
"bindings": {
"contentController": {"<-": "@panelItems"}
}
},
"itemPanel":
{
"prototype": "ui/components/itemPanel.reel",
"properties":{
"element": {"#": "itemPanel"}
},
"bindings": {
"groupData": {"<-": "@pagePanel.objectAtCurrentIteration"}
}
},
the getter/setter in the itemPanel.js code:
_groupData: {
value: null
},
groupData: {
set: function(val){
if (val) {
this._groupData = val;
this.configureSlides();
this.needsDraw = true;
}
},
get: function(){
return this._groupData;
}
},
_groupLocked: {
value:true
},
groupLocked: {
set: function(val){
this._groupLocked = val;
if (this.lockBtn) {
if (val) {
this.lockBtn.src = "assets/icons/locked_16.png";
} else {
this.lockBtn.src = "assets/icons/unlocked_16.png";
this.dispatchEventNamed('groupUnlocked',true,true,this.groupData);
}
}
},
get: function(){
return this._groupLocked;
}
},
groupData:{
value:null
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment