|
Lines 43-54
define([
Link Here
|
| 43 |
_thumbnailBox: null, |
43 |
_thumbnailBox: null, |
| 44 |
initialBoxValue: null, |
44 |
initialBoxValue: null, |
| 45 |
|
45 |
|
|
|
46 |
_updateValue: function(attr, oldVal, newVal) { |
| 47 |
console.log('### ThumbnailDndTile:_updateValue() - old value:', this.value, ' new value:', this.get('value'), ' arguments:', arguments); |
| 48 |
this._set('value', newVal); |
| 49 |
}, |
| 50 |
|
| 46 |
buildRendering: function() { |
51 |
buildRendering: function() { |
| 47 |
this.inherited(arguments); |
52 |
this.inherited(arguments); |
| 48 |
|
53 |
|
| 49 |
this._thumbnailBox = new ThumbnailBox({ |
54 |
this._thumbnailBox = new ThumbnailBox({ |
| 50 |
value: this.initialBoxValue |
55 |
value: this.initialBoxValue |
| 51 |
}); |
56 |
}); |
|
|
57 |
this._thumbnailBox.watch('value', lang.hitch(this, '_updateValue')); |
| 52 |
|
58 |
|
| 53 |
var styleContainer = put('div.styleContainer'); |
59 |
var styleContainer = put('div.styleContainer'); |
| 54 |
var leftNav = put('div.leftNav.dojoDndHandle'); |
60 |
var leftNav = put('div.leftNav.dojoDndHandle'); |
|
Lines 120-130
define([
Link Here
|
| 120 |
// This reference is used so that there is always only one empty ThumbnailDndTile |
126 |
// This reference is used so that there is always only one empty ThumbnailDndTile |
| 121 |
_emptyTileNode: null, |
127 |
_emptyTileNode: null, |
| 122 |
|
128 |
|
|
|
129 |
labelPosition: 'top', |
| 130 |
|
| 123 |
buildRendering: function() { |
131 |
buildRendering: function() { |
| 124 |
this.inherited(arguments); |
132 |
this.inherited(arguments); |
| 125 |
this._createDndSource(); |
133 |
this._createDndSource(); |
| 126 |
}, |
134 |
}, |
| 127 |
|
135 |
|
|
|
136 |
_updateValue: function() { |
| 137 |
console.log('### ThumbnailDndList:_updateValue() - old value:', this.value, ' new value:', this.get('value'), ' arguments:', arguments); |
| 138 |
this._set('value', this.get('value')); |
| 139 |
}, |
| 140 |
|
| 128 |
_createDndSource: function() { |
141 |
_createDndSource: function() { |
| 129 |
this.dndSource = new Source(this.domNode, { |
142 |
this.dndSource = new Source(this.domNode, { |
| 130 |
type: ['thumbnailDndList'], |
143 |
type: ['thumbnailDndList'], |
|
Lines 150-161
define([
Link Here
|
| 150 |
'class': 'thumbnailDndTile', |
163 |
'class': 'thumbnailDndTile', |
| 151 |
disabled: this.get('disabled') |
164 |
disabled: this.get('disabled') |
| 152 |
}); |
165 |
}); |
|
|
166 |
tile.watch('value', lang.hitch(this, '_updateValue')); |
| 153 |
tile.on('deleteRequest', lang.hitch(this, '_destroyTile', tile)); |
167 |
tile.on('deleteRequest', lang.hitch(this, '_destroyTile', tile)); |
| 154 |
tile.on('moveUp', lang.hitch(this, '_moveTile', tile, true)); |
168 |
tile.on('moveUp', lang.hitch(this, '_moveTile', tile, true)); |
| 155 |
tile.on('moveDown', lang.hitch(this, '_moveTile', tile, false)); |
169 |
tile.on('moveDown', lang.hitch(this, '_moveTile', tile, false)); |
| 156 |
tile.on('addBefore', lang.hitch(this, '_addEmptyTile', tile, true)); |
170 |
tile.on('addBefore', lang.hitch(this, '_addEmptyTile', tile, true)); |
| 157 |
tile.on('addAfter', lang.hitch(this, '_addEmptyTile', tile, false)); |
171 |
tile.on('addAfter', lang.hitch(this, '_addEmptyTile', tile, false)); |
| 158 |
|
172 |
|
| 159 |
return { |
173 |
return { |
| 160 |
node: tile.domNode, |
174 |
node: tile.domNode, |
| 161 |
data: tile, |
175 |
data: tile, |
|
Lines 175-180
define([
Link Here
|
| 175 |
if (this.dndSource.getAllNodes().length === 0) { |
189 |
if (this.dndSource.getAllNodes().length === 0) { |
| 176 |
this._addEmptyTile(); |
190 |
this._addEmptyTile(); |
| 177 |
} |
191 |
} |
|
|
192 |
this._updateValue(); |
| 178 |
}, |
193 |
}, |
| 179 |
|
194 |
|
| 180 |
_moveTile: function(tile, before) { |
195 |
_moveTile: function(tile, before) { |
|
Lines 184-189
define([
Link Here
|
| 184 |
return; |
199 |
return; |
| 185 |
} |
200 |
} |
| 186 |
put(referenceNode, putCombinator, tile.domNode); |
201 |
put(referenceNode, putCombinator, tile.domNode); |
|
|
202 |
this._updateValue(); |
| 187 |
}, |
203 |
}, |
| 188 |
|
204 |
|
| 189 |
_addEmptyTile: function(tile, before) { |
205 |
_addEmptyTile: function(tile, before) { |
|
Lines 224-229
define([
Link Here
|
| 224 |
if (this.dndSource.getAllNodes().length === 0) { |
240 |
if (this.dndSource.getAllNodes().length === 0) { |
| 225 |
this._addEmptyTile(); |
241 |
this._addEmptyTile(); |
| 226 |
} |
242 |
} |
|
|
243 |
this._set('value', value); |
| 227 |
}, |
244 |
}, |
| 228 |
|
245 |
|
| 229 |
_getValueAttr: function() { |
246 |
_getValueAttr: function() { |