OSDN Git Service

clean
[pettanr/pettanr.git] / app / assets / javascripts / editor / panel_editor / dock.js.coffee
index 6fb3de4..c90dab0 100644 (file)
@@ -71,9 +71,8 @@ class Editor.PanelEditor.Dock extends Editor.EditorModule.DockBase
       tab.label\r
     labels = new Tag.Ul({contents: l, class_name: @dom_labels_class()})\r
     this.$el.append(labels.render().el)\r
-    _this = this\r
-    _.each @tabs, (tab) ->\r
-      _this.$el.append(tab.render().el)\r
+    _.each @tabs, (tab) =>\r
+      this.$el.append(tab.render().el)\r
     this\r
   \r
   editor: () ->\r
@@ -129,13 +128,12 @@ class Editor.EditorModule.DockModule.ElementBay extends Editor.EditorModule.Dock
   \r
   initialize: (options) ->\r
     super(options)\r
-    _this = this\r
     i = 0\r
-    _.each @elements(), (element) ->\r
+    _.each @elements(), (element) =>\r
       tab = new Editor.EditorModule.DockModule.ElementBoard({\r
-        parent: _this, index: i, name: element.item_name(), element: element\r
+        parent: this, index: i, name: element.item_name(), element: element\r
       })\r
-      _this.add_tab(\r
+      @add_tab(\r
         tab, \r
         new Editor.EditorModule.DockModule.TabModule.ElementBoardLabel({parent: tab, name: element.item_name()}), \r
         new Editor.EditorModule.DockModule.TabModule.ElementBoardBody({parent: tab})\r
@@ -168,15 +166,14 @@ class Editor.EditorModule.DockModule.ElementBay.ElementsTabs extends Backbone.Vi
   \r
   render: () ->\r
     this.$el.html('')\r
-    _this = this\r
-    labels = _.map @tabs, (tab) ->\r
+    labels = _.map @tabs, (tab) =>\r
       tab.label\r
     inner_elements_tabs = new Editor.EditorModule.DockModule.ElementBay.InnerElementsTabs({\r
       labels: labels\r
     })\r
     this.$el.append(inner_elements_tabs.render().el)\r
-    _.each @tabs, (tab) ->\r
-      _this.$el.append(tab.body.render().el)\r
+    _.each @tabs, (tab) =>\r
+      this.$el.append(tab.body.render().el)\r
     this\r
   \r
 class Editor.EditorModule.DockModule.ElementBay.InnerElementsTabs extends Backbone.View\r
@@ -188,9 +185,8 @@ class Editor.EditorModule.DockModule.ElementBay.InnerElementsTabs extends Backbo
   \r
   render: () ->\r
     this.$el.html('')\r
-    _this = this\r
-    _.each @labels, (label) ->\r
-      _this.$el.append(label.render().el)\r
+    _.each @labels, (label) =>\r
+      this.$el.append(label.render().el)\r
     this\r
   \r
 class Editor.EditorModule.DockModule.TabModule.ElementBayLabel extends Editor.EditorModule.DockModule.TabModule.BayLabel\r
@@ -241,13 +237,12 @@ class Editor.EditorModule.DockModule.ScenarioBay extends Editor.EditorModule.Doc
   \r
   initialize: (options) ->\r
     super(options)\r
-    _this = this\r
     i = 0\r
-    _.each @elements(), (element) ->\r
+    _.each @elements(), (element) =>\r
       tab = new Editor.EditorModule.DockModule.ScenarioBoard({\r
-        parent: _this, index: i, name: element.item_name(), element: element\r
+        parent: this, index: i, name: element.item_name(), element: element\r
       })\r
-      _this.add_tab(\r
+      @add_tab(\r
         tab, \r
         new Editor.EditorModule.DockModule.TabModule.ScenarioBoardLabel({parent: tab, caption: element.item_name()}), \r
         new Editor.EditorModule.DockModule.TabModule.ScenarioBoardBody({parent: tab})\r
@@ -257,13 +252,12 @@ class Editor.EditorModule.DockModule.ScenarioBay extends Editor.EditorModule.Doc
   render: () ->\r
     this.$el.html('')\r
     this.$el.attr('id', @body.dom_id())\r
-    _this = this\r
     elements_tabs = new Editor.EditorModule.DockModule.ScenarioBay.ScenarioTabs({\r
       tabs: @tabs\r
     })\r
     this.$el.append(elements_tabs.render().el)\r
-    _.each @tabs, (tab) ->\r
-      _this.$el.append(tab.body.render().el)\r
+    _.each @tabs, (tab) =>\r
+      this.$el.append(tab.body.render().el)\r
     elements_tabs.$el.tabs()\r
     this\r
   \r
@@ -283,9 +277,8 @@ class Editor.EditorModule.DockModule.ScenarioBay.ScenarioTabs extends Backbone.V
   \r
   render: () ->\r
     this.$el.html('')\r
-    _this = this\r
-    _.each @tabs, (tab) ->\r
-      _this.$el.append(tab.label.render().el)\r
+    _.each @tabs, (tab) =>\r
+      this.$el.append(tab.label.render().el)\r
     this\r
   \r
 class Editor.EditorModule.DockModule.TabModule.ScenarioBayLabel extends Editor.EditorModule.DockModule.TabModule.BayLabel\r
@@ -318,13 +311,12 @@ class Editor.EditorModule.DockModule.PriorityBay extends Editor.EditorModule.Doc
   \r
   initialize: (options) ->\r
     super(options)\r
-    _this = this\r
     i = 0\r
-    _.each @elements(), (element) ->\r
+    _.each @elements(), (element) =>\r
       tab = new Editor.EditorModule.DockModule.PriorityBoard({\r
-        parent: _this, index: i, name: element.item_name(), element: element\r
+        parent: this, index: i, name: element.item_name(), element: element\r
       })\r
-      _this.add_tab(\r
+      @add_tab(\r
         tab, \r
         new Editor.EditorModule.DockModule.TabModule.PriorityBoardLabel({parent: tab, name: element.item_name()}), \r
         new Editor.EditorModule.DockModule.TabModule.PriorityBoardBody({parent: tab})\r
@@ -334,13 +326,12 @@ class Editor.EditorModule.DockModule.PriorityBay extends Editor.EditorModule.Doc
   render: () ->\r
     this.$el.html('')\r
     this.$el.attr('id', @body.dom_id())\r
-    _this = this\r
     elements_tabs = new Editor.EditorModule.DockModule.PriorityBay.PriorityTabs({\r
       tabs: @tabs\r
     })\r
     this.$el.append(elements_tabs.render().el)\r
-    _.each @tabs, (tab) ->\r
-      _this.$el.append(tab.body.render().el)\r
+    _.each @tabs, (tab) =>\r
+      this.$el.append(tab.body.render().el)\r
     elements_tabs.$el.tabs()\r
     this\r
   \r
@@ -360,9 +351,8 @@ class Editor.EditorModule.DockModule.PriorityBay.PriorityTabs extends Backbone.V
   \r
   render: () ->\r
     this.$el.html('')\r
-    _this = this\r
-    _.each @tabs, (tab) ->\r
-      _this.$el.append(tab.label.render().el)\r
+    _.each @tabs, (tab) =>\r
+      this.$el.append(tab.label.render().el)\r
     this\r
   \r
 class Editor.EditorModule.DockModule.TabModule.PriorityBayLabel extends Editor.EditorModule.DockModule.TabModule.BayLabel\r