Created
November 25, 2015 17:05
-
-
Save steve-ross/a3df6a74d3256bc554e5 to your computer and use it in GitHub Desktop.
autorun
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Template.afSelect_semanticUI.onRendered(function() { | |
let node = this.$(this.firstNode); | |
node.dropdown(_.extend({ | |
fullTextSearch : this.data.atts.fullTextSearch || false, | |
allowAdditions : this.data.atts.allowAdditions || false, | |
maxSelections : this.data.atts.maxSelections || false, | |
allowCategorySelection: this.data.atts.allowCategorySelection || false, | |
useLabels : this.data.atts.useLabels === false ? false : true | |
}, this.data.atts.settings)); | |
this.autorun((c) => { | |
let data = Template.currentData(); | |
let prevData = {value: null}; | |
if (data.value && data.value !== prevData.value) { | |
prevData.value = data.value; | |
node.dropdown("set selected", data.value); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment