Newer
Older
define(['jquery', 'underscore', 'backbone', 'appState'], function($, _, Backbone, appState){
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
el: "#console",
events: {
},
initialize: function(){
this.listenTo(appState, "change:consoleIsVisible", this._setVisibility);
this._setWidth();
this._setVisibility();
},
_setWidth: function(immediately){
var padding = "0";
if (appState.get("menuIsVisible")) padding = "430px";
if (immediately) this.$el.css({"padding-right":padding});
else this.$el.animate({"padding-right":padding});
},
_setVisibility: function(){
if (appState.get("consoleIsVisible")) this.show();
else this.hide();
},
show: function(){
this.$el.fadeIn();
},
hide: function(){
this.$el.fadeOut();
}
});
return new Console();