Permalink
Browse files

performance: use save button

  • Loading branch information...
1 parent 63c4f88 commit 0bda586cbde8a819382789c9bd0487fbbcbcb9f6 @brownman committed Oct 31, 2012
@@ -17,7 +17,9 @@
-<input class="save btn" type="button" value='<%= obj2.status %>' />
+
+
+<input class="btn save" type="button" value="<%= obj2 %>">
<div class="btn-group todo-array " <%= obj.direction ? 'dir="rtl"' : '' %> >
@@ -17,7 +17,13 @@
-<input class="save btn" type="button" value='<%= status %>' />
+<input width='0px' class="btn save" type="button" value="<%= obj2 %>" />
+
+<button width='0px' class="btn save" type="submit">
+<%= obj2 %>
+</button>
+
+<input class="btn save" type="button" value="<%= obj2 %>">
<div class="btn-group todo-array " <%= obj.direction ? 'dir="rtl"' : '' %> >
@@ -4,7 +4,7 @@ class RailsBackboneRelational.Views.Comments.CommentView extends Backbone.View
template: JST["backbone/templates/comments/comment"]
@array = []
- @status = 'false'
+ @status = 'saved'
events:
"click .destroy" : "destroy"
@@ -22,8 +22,14 @@ class RailsBackboneRelational.Views.Comments.CommentView extends Backbone.View
@status = 'false'
#@update_status(false)
- this.model.bind('change', this.render);
-
+
+ @status = 'saved!'
+ this.model.bind('change', this.before_render);
+
+ before_render:() =>
+ @status = 'saved'
+ @render()
+
get_array: () ->
@array
@@ -83,10 +89,11 @@ class RailsBackboneRelational.Views.Comments.CommentView extends Backbone.View
array = @get_array()
array[num...num] = ['=']
@array = array
- @update_status('true')
+ #@update_status('true')
+ @status = 'not saved!'
@render()
-
- update_status: (sign) ->
+
+ update_status2: (sign) ->
item = @$('.save')
console.log(item)
if(sign)
@@ -4,7 +4,7 @@ class RailsBackboneRelational.Views.Comments.CommentView extends Backbone.View
template: JST["backbone/templates/comments/comment"]
@array = []
- @status = 'false'
+ @status = 'saved'
events:
"click .destroy" : "destroy"
@@ -19,8 +19,13 @@ class RailsBackboneRelational.Views.Comments.CommentView extends Backbone.View
initialize: () ->
@array = @model.split()
+ @status = 'false'
+
+ #@update_status(false)
+
+ @status = 'saved!'
this.model.bind('change', this.render);
- @update_status(false)
+
get_array: () ->
@array
@@ -80,10 +85,11 @@ class RailsBackboneRelational.Views.Comments.CommentView extends Backbone.View
array = @get_array()
array[num...num] = ['=']
@array = array
- @update_status('true')
+ #@update_status('true')
+ @status = 'not saved!'
@render()
-
- update_status: (sign) ->
+
+ update_status2: (sign) ->
item = @$('.save')
console.log(item)
if(sign)
@@ -11,98 +11,5 @@
*= require_self
*= require_tree .
*/
-div.new_comment {
-background-color:#099993;
-
-}
-
-td {
-padding-top: 1em;
-/*
- *vertical-align:top;
- */
-text-align:left;
-height: 100%;
-
-
-}
-tr {
-/*
- *width: 100%;
- */
-}
-
-button {
-text-align: left;
-
-/*
- *padding-left: 0px;
- */
-/*
- *text-align: left;
- */
-/*
- *padding: 0px;
- */
- padding: 2em;
-
-
-
-
-border:2px solid #000000;
-
-}
-
-.test
-{
-
-/*
- *text-justify:inter-word;
- */
-
-
-
-/*
- *text-align:justify;
- */
-
-white-space:pre;
-/*
- *overflow:hidden;
- */
-border:1px solid #000000;
-/*
- *height: 4em;
- */
-
-/*
- *overflow-y:none;
- */
-
-}
-
-.test2:hover {
-
-white-space:normal;
-
-border:1px solid #0000ff;
-font-stretch:expanded;
-font-weight:bold;
-/*
- *transition-delay: 1s;
- */
-}
-.test1{
-
-white-space:normal;
-
-border:2px solid #ff0000;
-font-stretch:expanded;
-font-weight:bold;
-/*
- *transition-delay: 1s;
- */
-}
-
@@ -11,98 +11,5 @@
*= require_self
*= require_tree .
*/
-div.new_comment {
-background-color:#0ffcc3;
-
-}
-
-td {
-padding-top: 1em;
-/*
- *vertical-align:top;
- */
-text-align:left;
-height: 100%;
-
-
-}
-tr {
-/*
- *width: 100%;
- */
-}
-
-button {
-text-align: left;
-
-/*
- *padding-left: 0px;
- */
-/*
- *text-align: left;
- */
-/*
- *padding: 0px;
- */
- padding: 2em;
-
-
-
-
-border:2px solid #000000;
-
-}
-
-.test
-{
-
-/*
- *text-justify:inter-word;
- */
-
-
-
-/*
- *text-align:justify;
- */
-
-white-space:pre;
-/*
- *overflow:hidden;
- */
-border:1px solid #000000;
-/*
- *height: 4em;
- */
-
-/*
- *overflow-y:none;
- */
-
-}
-
-.test2:hover {
-
-white-space:normal;
-
-border:1px solid #0000ff;
-font-stretch:expanded;
-font-weight:bold;
-/*
- *transition-delay: 1s;
- */
-}
-.test1{
-
-white-space:normal;
-
-border:2px solid #ff0000;
-font-stretch:expanded;
-font-weight:bold;
-/*
- *transition-delay: 1s;
- */
-}
-
Oops, something went wrong.

0 comments on commit 0bda586

Please sign in to comment.