Revision cb6d8025 snf-cyclades-app/synnefo/ui/new_ui/ui/javascripts/ember/views/toggle-lt-bar.js
b/snf-cyclades-app/synnefo/ui/new_ui/ui/javascripts/ember/views/toggle-lt-bar.js | ||
---|---|---|
2 | 2 |
tagName: 'a', |
3 | 3 |
classNames: ['toggle-lt-bar'], |
4 | 4 |
templateName: 'toggle-lt-bar', |
5 |
|
|
5 | 6 |
didInsertElement: function() { |
6 | 7 |
var that = this; |
7 | 8 |
this.$().click(function (e) { |
8 | 9 |
that.aux_function(400,e); |
9 | 10 |
}); |
11 |
this.$().find('img-wrap a').click(function(e) { |
|
12 |
// na kleinei ti lista.... |
|
13 |
}); |
|
10 | 14 |
}, |
15 |
|
|
11 | 16 |
aux_function: function (speed,e) { |
17 |
e.preventDefault(); |
|
18 |
e.stopPropagation(); |
|
19 |
this.listToggle(speed,e); |
|
20 |
}, |
|
21 |
|
|
22 |
listToggle: function (speed,e) { |
|
12 | 23 |
var cmarg = parseInt($('.lt-bar').width()) - parseInt($('.toggle-lt-bar').outerWidth(true)); |
13 | 24 |
var ctemp = cmarg / parseInt($('.lt-bar').width()); |
14 | 25 |
var cvelocity = parseInt($('.lt-bar').width())/speed; |
15 | 26 |
var cdelay = parseInt($('.toggle-lt-bar').outerWidth(true))/cvelocity; |
16 |
e.preventDefault(); |
|
17 |
e.stopPropagation(); |
|
18 | 27 |
var self =this; |
19 | 28 |
var marg = ''; |
29 |
|
|
20 | 30 |
if($(this).hasClass('fix-position')) { |
21 | 31 |
marg = parseInt($(self).css('marginLeft')) - cmarg; |
22 | 32 |
$(this).animate({ |
Also available in: Unified diff