pulse-meter 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module PulseMeter
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
@@ -83,7 +83,7 @@ $ ->
83
83
 
84
84
  refetch: ->
85
85
  if @needFetch()
86
- @fetch()
86
+ @forceUpdate()
87
87
  @setNextFetch()
88
88
 
89
89
  cutoffValue: (v, min, max) ->
@@ -100,6 +100,12 @@ $ ->
100
100
  @cutoffValue(v, min, max)
101
101
  , this)
102
102
  , this)
103
+
104
+ forceUpdate: ->
105
+ @fetch {
106
+ success: (model, response) ->
107
+ model.trigger('change')
108
+ }
103
109
  }
104
110
 
105
111
  WidgetList = Backbone.Collection.extend {
@@ -184,7 +190,7 @@ $ ->
184
190
  }
185
191
 
186
192
  refresh: ->
187
- @model.fetch()
193
+ @model.forceUpdate()
188
194
 
189
195
  setRefresh: ->
190
196
  needRefresh = @$el.find('#need-refresh').is(":checked")
@@ -83,7 +83,7 @@
83
83
  },
84
84
  refetch: function() {
85
85
  if (this.needFetch()) {
86
- this.fetch();
86
+ this.forceUpdate();
87
87
  return this.setNextFetch();
88
88
  }
89
89
  },
@@ -103,6 +103,13 @@
103
103
  return this.cutoffValue(v, min, max);
104
104
  }, this);
105
105
  }, this);
106
+ },
107
+ forceUpdate: function() {
108
+ return this.fetch({
109
+ success: function(model, response) {
110
+ return model.trigger('change');
111
+ }
112
+ });
106
113
  }
107
114
  });
108
115
  WidgetList = Backbone.Collection.extend({
@@ -186,7 +193,7 @@
186
193
  "click #need-refresh": 'setRefresh'
187
194
  },
188
195
  refresh: function() {
189
- return this.model.fetch();
196
+ return this.model.forceUpdate();
190
197
  },
191
198
  setRefresh: function() {
192
199
  var needRefresh;
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pulse-meter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-06-01 00:00:00.000000000 Z
13
+ date: 2012-06-03 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: gon-sinatra