Revision 1b6dd4b5 snf-cyclades-app/synnefo/ui/new_ui/ui/javascripts/okeanos-ember/ember-all.js
b/snf-cyclades-app/synnefo/ui/new_ui/ui/javascripts/okeanos-ember/ember-all.js | ||
---|---|---|
159 | 159 |
addNewBtn: false, |
160 | 160 |
template: Ember.TEMPLATES['snfElem'], |
161 | 161 |
tagName: 'li', |
162 |
selectable: true, |
|
163 |
initSelect: 'unchecked', |
|
162 | 164 |
classNameBindings: ['status'], |
163 | 165 |
attributeBindings: ['data-status'], |
164 | 166 |
'data-status': function() { |
... | ... | |
170 | 172 |
}); |
171 | 173 |
|
172 | 174 |
|
175 |
// to evala ws view gt thelw na kanw diaxeirisi tou interaction tou xristi |
|
176 |
Okeanos.ElementSidebarView = Ember.View.extend({ |
|
177 |
tagName: 'ul', |
|
178 |
classNames: ['side-actions'], |
|
179 |
template: Ember.TEMPLATES['elementSidebar'] |
|
180 |
}); |
|
181 |
|
|
173 | 182 |
/* Components */ |
174 | 183 |
|
175 | 184 |
Okeanos.Btn1Component = Ember.Component.extend({ |
... | ... | |
182 | 191 |
Okeanos.AddNewComponent = Ember.Component.extend({ |
183 | 192 |
template: Ember.TEMPLATES['snfElem'], |
184 | 193 |
addNewBtn: true, |
194 |
selectable: false, |
|
185 | 195 |
icon: function() { |
186 | 196 |
baseIcon = Okeanos.places.findBy('destination', this.get('type')).icon; |
187 | 197 |
return baseIcon.replace('outline', 'create-full'); |
... | ... | |
202 | 212 |
return msg + 'Network'; |
203 | 213 |
}.property() |
204 | 214 |
|
205 |
}) |
|
215 |
});
|
|
206 | 216 |
|
207 | 217 |
Okeanos.LoginMenuComponent = Ember.Component.extend({ |
208 | 218 |
classNames: ['login'], |
... | ... | |
218 | 228 |
|
219 | 229 |
} |
220 | 230 |
}); |
231 |
|
|
232 |
Okeanos.SnfCheckboxComponent = Ember.Component.extend({ |
|
233 |
tagName: 'a', |
|
234 |
classNames: ['check'], |
|
235 |
initState: function() { |
|
236 |
return this.get('initState'); |
|
237 |
}.property(), |
|
238 |
template: Ember.TEMPLATES['snf-checkbox'], |
|
239 |
didInsertElement: function() { |
|
240 |
var domRef = this.$(); |
|
241 |
var self =this; |
|
242 |
this.setInitClasses(); |
|
243 |
domRef.click(function(e) { |
|
244 |
e.preventDefault(); |
|
245 |
e.stopPropagation(); |
|
246 |
self.changeState(domRef); |
|
247 |
// ui.entitiesActionsEnabled(); |
|
248 |
console.log(self.get('elementID')) |
|
249 |
}); |
|
250 |
}, |
|
251 |
setInitClasses: function() { |
|
252 |
var self =this.$(); |
|
253 |
switch(this.initState){ |
|
254 |
case 'unchecked': { |
|
255 |
this.uncheck(self); |
|
256 |
break; |
|
257 |
} |
|
258 |
case 'prechecked': { |
|
259 |
self.find('span').addClass('prechecked') |
|
260 |
this.check(self); |
|
261 |
break; |
|
262 |
} |
|
263 |
} |
|
264 |
}, |
|
265 |
// used to be in ui.checkbox |
|
266 |
changeState : function(checkbox_link) { |
|
267 |
$(checkbox_link).find('.snf-checkbox-unchecked, .snf-checkbox-checked').toggleClass('snf-checkbox-unchecked snf-checkbox-checked'); |
|
268 |
$(checkbox_link).closest('li').toggleClass('selected'); |
|
269 |
}, |
|
270 |
check : function(checkbox_link) { |
|
271 |
$(checkbox_link).find('span').removeClass('snf-checkbox-unchecked').addClass('snf-checkbox-checked'); |
|
272 |
$(checkbox_link).closest('li').addClass('selected'); |
|
273 |
}, |
|
274 |
uncheck : function(checkbox_link) { |
|
275 |
$(checkbox_link).find('span').removeClass('snf-checkbox-checked').addClass('snf-checkbox-unchecked'); |
|
276 |
$(checkbox_link).closest('li').removeClass('selected'); |
|
277 |
}, |
|
278 |
|
|
279 |
reset: function(area) { |
|
280 |
$(area).find('.snf-radio-checked').not('.prechecked').toggleClass('snf-radio-checked snf-radio-unchecked'); |
|
281 |
$(area).find('.snf-radio-unchecked.prechecked').toggleClass('snf-radio-checked snf-radio-unchecked'); |
|
282 |
}, |
|
283 |
}); |
Also available in: Unified diff