Permalink
Browse files

change layout for mobile

  • Loading branch information...
1 parent 56a671b commit a99f86d0d2661f74ba13484ee9c1b95a9aff8e67 @brownman committed Nov 13, 2012
@@ -22,7 +22,16 @@ class RailsBackboneRelational.Views.Comments.CommentView extends Backbone.View
#"hover .todo-array button": "show_tooltip"
- initialize: () ->
+ initialize: () =>
+
+
+ console.log(this)
+
+ console.log(@options)
+ num = @options['c_length']
+ #this.model.collection.length
+ @update_span(num)
+ #@options.c_length
@status = 'saved'
@seconds = 10
this.model.bind('change', this.before_render);
@@ -23,6 +23,14 @@ class RailsBackboneRelational.Views.Comments.CommentView extends Backbone.View
#"hover .todo-array button": "show_tooltip"
initialize: () ->
+
+
+ console.log(this)
+
+ console.log(@options)
+ num = this.model.collection.length
+ @update_span(num)
+ #@options.c_length
@status = 'saved'
@seconds = 10
this.model.bind('change', this.before_render);
@@ -115,7 +123,7 @@ class RailsBackboneRelational.Views.Comments.CommentView extends Backbone.View
inta = parseInt(12/num)
str = "span" + inta
console.log(this)
- @el.className = srt
+ @el.className = str
save_array: () ->
@@ -66,14 +66,14 @@ class RailsBackboneRelational.Views.Comments.IndexView extends Backbone.View
addAll: () =>
#console.log(@options.comments)
comments1 = @options.comments
- comments1.each(@addOne, comments1.length)
+ comments1.each(@addOne, num: comments1.length)
- addOne: (comment, num) =>
+ addOne: (comment ) =>
#this.trigger('somethingHappened')
abcd =
model : comment
- c_length: num
+ c_length: @num.toString()
view = new RailsBackboneRelational.Views.Comments.CommentView(abcd)
@@ -65,13 +65,15 @@ class RailsBackboneRelational.Views.Comments.IndexView extends Backbone.View
addAll: () =>
#console.log(@options.comments)
- @options.comments.each(@addOne)
+ comments1 = @options.comments
+ comments1.each(@addOne, num: comments1.length)
- addOne: (comment) =>
+ addOne: (comment ) =>
#this.trigger('somethingHappened')
abcd =
model : comment
+ c_length: num
view = new RailsBackboneRelational.Views.Comments.CommentView(abcd)
@@ -83,11 +85,15 @@ class RailsBackboneRelational.Views.Comments.IndexView extends Backbone.View
render: =>
comments = @options.comments.toJSON()
+ @num = @options.comments.length
+
obj =
comments: comments
- num: @num
+ #num: @num
console.log('Comments_collection: ' + obj)
- $(@el).html(@template(obj))
+
+ $(@el).html(@template())
+ #$(@el).html(@template(obj))
@addAll()
return this
@@ -7,7 +7,8 @@
<%= csrf_meta_tags %>
-<meta name="viewport" content="width=device-width, initial-scale=1.0">
+
+<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
</head>
@@ -6,7 +6,8 @@
<%= javascript_include_tag "application" %>
<%= csrf_meta_tags %>
- <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1" />
+
+<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>

0 comments on commit a99f86d

Please sign in to comment.