Changeset View
Changeset View
Standalone View
Standalone View
webroot/rsrc/js/application/projects/WorkboardDropEffect.js
| /** | /** | ||||
| * @provides javelin-workboard-drop-effect | * @provides javelin-workboard-drop-effect | ||||
| * @requires javelin-install | * @requires javelin-install | ||||
| * javelin-dom | * javelin-dom | ||||
| * @javelin | * @javelin | ||||
| */ | */ | ||||
| JX.install('WorkboardDropEffect', { | JX.install('WorkboardDropEffect', { | ||||
| properties: { | properties: { | ||||
| icon: null, | icon: null, | ||||
| color: null, | color: null, | ||||
| content: null, | content: null, | ||||
| isTriggerEffect: false, | |||||
| isHeader: false, | |||||
| conditions: [] | conditions: [] | ||||
| }, | }, | ||||
| statics: { | statics: { | ||||
| newFromDictionary: function(map) { | newFromDictionary: function(map) { | ||||
| return new JX.WorkboardDropEffect() | return new JX.WorkboardDropEffect() | ||||
| .setIcon(map.icon) | .setIcon(map.icon) | ||||
| .setColor(map.color) | .setColor(map.color) | ||||
| .setContent(JX.$H(map.content)) | .setContent(JX.$H(map.content)) | ||||
| .setIsTriggerEffect(map.isTriggerEffect) | |||||
| .setIsHeader(map.isHeader) | |||||
| .setConditions(map.conditions || []); | .setConditions(map.conditions || []); | ||||
| } | } | ||||
| }, | }, | ||||
| members: { | members: { | ||||
| newNode: function() { | newNode: function() { | ||||
| var icon = new JX.PHUIXIconView() | var icon = new JX.PHUIXIconView() | ||||
| .setIcon(this.getIcon()) | .setIcon(this.getIcon()) | ||||
| .setColor(this.getColor()) | .setColor(this.getColor()) | ||||
| .getNode(); | .getNode(); | ||||
| return JX.$N('li', {}, [icon, this.getContent()]); | var attributes = {}; | ||||
| if (this.getIsHeader()) { | |||||
| attributes.className = 'workboard-drop-preview-header'; | |||||
| } | |||||
| return JX.$N('li', attributes, [icon, this.getContent()]); | |||||
| }, | }, | ||||
| isEffectVisibleForCard: function(card) { | isEffectVisibleForCard: function(card) { | ||||
| var conditions = this.getConditions(); | var conditions = this.getConditions(); | ||||
| var properties = card.getProperties(); | var properties = card.getProperties(); | ||||
| for (var ii = 0; ii < conditions.length; ii++) { | for (var ii = 0; ii < conditions.length; ii++) { | ||||
| var condition = conditions[ii]; | var condition = conditions[ii]; | ||||
| Show All 21 Lines | |||||