diff options
author | Valerio Virgillito | 2012-05-03 16:18:00 -0700 |
---|---|---|
committer | Valerio Virgillito | 2012-05-03 16:18:00 -0700 |
commit | fec9ccee11ea21ffc95edce6e89d0d302b63e3d8 (patch) | |
tree | 3839c34260fcca2b19aa4e307c4e63769a8ab52f /js/code-editor/ui | |
parent | 0e1c87871489c1d5d8deb609174d8876eb579169 (diff) | |
download | ninja-fec9ccee11ea21ffc95edce6e89d0d302b63e3d8.tar.gz |
Code reformatting
Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'js/code-editor/ui')
-rw-r--r-- | js/code-editor/ui/code-editor-view-options.reel/code-editor-view-options.js | 121 |
1 files changed, 55 insertions, 66 deletions
diff --git a/js/code-editor/ui/code-editor-view-options.reel/code-editor-view-options.js b/js/code-editor/ui/code-editor-view-options.reel/code-editor-view-options.js index 07561580..a27d4450 100644 --- a/js/code-editor/ui/code-editor-view-options.reel/code-editor-view-options.js +++ b/js/code-editor/ui/code-editor-view-options.reel/code-editor-view-options.js | |||
@@ -10,81 +10,70 @@ var Montage = require("montage/core/core").Montage, | |||
10 | Component = require("montage/ui/component").Component; | 10 | Component = require("montage/ui/component").Component; |
11 | 11 | ||
12 | var CodeEditorViewOptions = exports.CodeEditorViewOptions = Montage.create(Component, { | 12 | var CodeEditorViewOptions = exports.CodeEditorViewOptions = Montage.create(Component, { |
13 | hasReel: { | ||
14 | value: true | ||
15 | }, | ||
16 | 13 | ||
17 | prepareForDraw: { | 14 | prepareForDraw: { |
18 | value: function() { | 15 | value: function() { |
19 | Object.defineBinding(this.codeCompleteCheck , "checked", { | 16 | Object.defineBinding(this.codeCompleteCheck , "checked", { |
20 | boundObject: this.application.ninja.codeEditorController, | 17 | boundObject: this.application.ninja.codeEditorController, |
21 | boundObjectPropertyPath: "automaticCodeComplete", | 18 | boundObjectPropertyPath: "automaticCodeComplete", |
22 | oneway : false | 19 | oneway : false |
23 | }); | 20 | }); |
24 | 21 | ||
25 | Object.defineBinding(this.zoomHottext , "value", { | 22 | Object.defineBinding(this.zoomHottext , "value", { |
26 | boundObject: this.application.ninja.codeEditorController, | 23 | boundObject: this.application.ninja.codeEditorController, |
27 | boundObjectPropertyPath: "zoomFactor", | 24 | boundObjectPropertyPath: "zoomFactor", |
28 | oneway : false | 25 | oneway : false |
29 | }); | 26 | }); |
30 | 27 | ||
31 | } | 28 | } |
32 | }, | 29 | }, |
33 | 30 | ||
34 | willDraw: { | 31 | didDraw: { |
35 | enumerable: false, | 32 | enumerable: false, |
36 | value: function() {} | 33 | value: function() { |
37 | }, | 34 | //this.format.addEventListener("click", this.handleFormat.bind(this), false); |
38 | draw: { | 35 | this.comment.addEventListener("click", this.handleComment.bind(this), false); |
39 | enumerable: false, | 36 | this.uncomment.addEventListener("click", this.handleUncomment.bind(this), false); |
40 | value: function() {} | 37 | this.themeSelect.addEventListener("change", this.handleThemeSelection.bind(this), false); |
41 | }, | 38 | this.shortKeys.addEventListener("click", this.handleShortKeys.bind(this), false); |
42 | didDraw: { | 39 | } |
43 | enumerable: false, | 40 | }, |
44 | value: function() { | ||
45 | //this.format.addEventListener("click", this.handleFormat.bind(this), false); | ||
46 | this.comment.addEventListener("click", this.handleComment.bind(this), false); | ||
47 | this.uncomment.addEventListener("click", this.handleUncomment.bind(this), false); | ||
48 | this.themeSelect.addEventListener("change", this.handleThemeSelection.bind(this), false); | ||
49 | this.shortKeys.addEventListener("click", this.handleShortKeys.bind(this), false); | ||
50 | } | ||
51 | }, | ||
52 | 41 | ||
53 | handleFormat:{ | 42 | handleFormat:{ |
54 | value: function(evt){ | 43 | value: function(evt){ |
55 | this.application.ninja.codeEditorController.autoFormatSelection(); | 44 | this.application.ninja.codeEditorController.autoFormatSelection(); |
56 | } | 45 | } |
57 | }, | 46 | }, |
58 | handleComment:{ | 47 | handleComment:{ |
59 | value: function(evt){ | 48 | value: function(evt){ |
60 | this.application.ninja.codeEditorController.commentSelection(true); | 49 | this.application.ninja.codeEditorController.commentSelection(true); |
61 | } | 50 | } |
62 | }, | 51 | }, |
63 | 52 | ||
64 | handleUncomment:{ | 53 | handleUncomment:{ |
65 | value: function(evt){ | 54 | value: function(evt){ |
66 | this.application.ninja.codeEditorController.commentSelection(false); | 55 | this.application.ninja.codeEditorController.commentSelection(false); |
67 | } | 56 | } |
68 | }, | 57 | }, |
69 | 58 | ||
70 | handleThemeSelection:{ | 59 | handleThemeSelection:{ |
71 | value: function(evt){ | 60 | value: function(evt){ |
72 | this.application.ninja.codeEditorController.editorTheme = this.themeSelect.options[this.themeSelect.selectedIndex].value; | 61 | this.application.ninja.codeEditorController.editorTheme = this.themeSelect.options[this.themeSelect.selectedIndex].value; |
73 | this.application.ninja.codeEditorController.handleThemeSelection(); | 62 | this.application.ninja.codeEditorController.handleThemeSelection(); |
74 | } | 63 | } |
75 | }, | 64 | }, |
76 | 65 | ||
77 | handleShortKeys:{ | 66 | handleShortKeys:{ |
78 | value:function(evt){ | 67 | value:function(evt){ |
79 | var list = this.shortKeys.querySelector(".list"); | 68 | var list = this.shortKeys.querySelector(".list"); |
80 | if(list && list.classList.contains("hide")){ | 69 | if(list && list.classList.contains("hide")){ |
81 | list.classList.remove("hide"); | 70 | list.classList.remove("hide"); |
82 | list.classList.add("show"); | 71 | list.classList.add("show"); |
83 | }else if(list && list.classList.contains("show")){ | 72 | }else if(list && list.classList.contains("show")){ |
84 | list.classList.remove("show"); | 73 | list.classList.remove("show"); |
85 | list.classList.add("hide"); | 74 | list.classList.add("hide"); |
86 | } | ||
87 | } | 75 | } |
88 | } | 76 | } |
77 | } | ||
89 | 78 | ||
90 | }); \ No newline at end of file | 79 | }); \ No newline at end of file |