kolo 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -28,11 +28,13 @@ class AdminViewModel extends ViewModel
28
28
  # doUpdate - update the given item in the database; on success, call @load()
29
29
  # doDelete - delete the given item from the database; on success call @items.remove(item) and then @load()
30
30
  # name - used for setting push-state
31
+ # canLoad - you can override this to prevent the load() method from making any calls. You should also call super when overriding as this checks for null and blank urls
31
32
  #
32
33
  # It expects models to have an updateAttributes(data) method and a valid method
34
+ #
33
35
  # After instantiation you can also set the following hooks:
34
36
  # db.sortFunction = function(a, b) { ... }
35
- # db.onBeforeLoad = function() { ... }
37
+ # db.onBeforeLoad = function() { ... }
36
38
  # db.onAfterLoad = function() { ... }
37
39
 
38
40
  class Db
@@ -68,8 +70,12 @@ class Db
68
70
  @items.push item
69
71
  return item
70
72
 
73
+ canLoad: =>
74
+ return false if !@url()? || @url() == ''
75
+ return true
76
+
71
77
  load: (autoReload = false)=>
72
- return if !@url()? || @url() == ''
78
+ return unless @canLoad()
73
79
  if !@selected()
74
80
  viewModel.systemNotification @plural, 'loading'
75
81
  viewModel.loading true
data/lib/kolo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Kolo
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kolo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-27 00:00:00.000000000 Z
12
+ date: 2013-04-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -93,7 +93,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
93
93
  version: '0'
94
94
  segments:
95
95
  - 0
96
- hash: 903078977
96
+ hash: 1053427121
97
97
  required_rubygems_version: !ruby/object:Gem::Requirement
98
98
  none: false
99
99
  requirements:
@@ -102,7 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
102
102
  version: '0'
103
103
  segments:
104
104
  - 0
105
- hash: 903078977
105
+ hash: 1053427121
106
106
  requirements: []
107
107
  rubyforge_project:
108
108
  rubygems_version: 1.8.24