Permalink
Browse files

Add: update body when resize

  • Loading branch information...
1 parent 771f9cb commit c619a8304c7a6c332d53b2c59514d9f51fbfe682 @hugomallet hugomallet committed Mar 15, 2013
Showing with 11 additions and 5 deletions.
  1. +1 −1 app/index.html
  2. +0 −2 app/scripts/views/application-view.js
  3. +9 −1 app/scripts/views/article-view.js
  4. +1 −1 app/styles/main.css
View
@@ -44,7 +44,7 @@ <h1 class="Three-Dee">Gravity Blog</h1>
</div>
<div id="blog">
- <canvas id="debug" width="560" height="0">
+ <canvas id="debug-canvas" width="560" height="0">
</canvas>
</div>
@@ -41,7 +41,6 @@ gravityBlog.Views.applicationView = BackboneGravity.Views.WorldView.extend({
},
reset: function() {
- console.log($(window).width())
this.createBody({
cid: 'ground',
width: $(window).width() * 2,
@@ -52,7 +51,6 @@ gravityBlog.Views.applicationView = BackboneGravity.Views.WorldView.extend({
dynamic: false
});
var self = this;
- console.log(self.collection.models.length)
function loop(i) {
if (!self.collection.models[i])
return;
@@ -24,7 +24,7 @@ gravityBlog.Views.articleView = Backbone.View.extend({
save: function() {
var inputVal = this.$el.find('.edit-title').val();
- var textareaVal= this.$el.find('.edit-content').val();
+ var textareaVal = this.$el.find('.edit-content').val();
if (inputVal !== '' && textareaVal !== '') {
this.model.set({
@@ -41,12 +41,20 @@ gravityBlog.Views.articleView = Backbone.View.extend({
this.$el.find('label').hide();
this.$el.find('p').hide();
this.$el.find('.tools').show();
+ this.trigger('resize', {
+ width: this.$el.outerWidth(),
+ height: this.$el.outerHeight()
+ });
},
hideEditTools: function() {
this.$el.find('label').show();
this.$el.find('p').show();
this.$el.find('.tools').hide();
+ this.trigger('resize', {
+ width: this.$el.outerWidth(),
+ height: this.$el.outerHeight()
+ });
},
update: function () {
View
Oops, something went wrong.

0 comments on commit c619a83

Please sign in to comment.