pinkman 0.9.2.2 → 0.9.3
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d88311ae5e6346a8f8f0a37a42b760792be7eb96
|
4
|
+
data.tar.gz: dc2677236094ac6a3fbf4aaa5e9e48e6f051f1a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 78876fca7ca135ce0915d7d0366ae6f34c3b84380a88fc99f1d07b785cdd5d1e8275bfcf007049eb754351c246e3a7040dcf042c298d14be1745c519f25d5eda
|
7
|
+
data.tar.gz: 607a11659a351b14c8e9f913d3f32ec8b2fa1cdce3f44a9c59e120e3156d0484e548d0e85d6064e95ef79d74f5fc79cdbc9bb95739e5a0694e509ef175258fb0
|
@@ -188,20 +188,22 @@ class window.PinkmanCollection extends window.PinkmanCommon
|
|
188
188
|
@count() > 0
|
189
189
|
|
190
190
|
# Desc: return the first object that matches
|
191
|
-
getBy: (attribute, value) ->
|
191
|
+
getBy: (attribute, value,callback) ->
|
192
192
|
if attribute? and value?
|
193
193
|
object = new Object
|
194
194
|
object[attribute] = value
|
195
|
-
return(@getByAttributes(object))
|
195
|
+
return(@getByAttributes(object,callback))
|
196
196
|
|
197
197
|
# Desc: return the first that matches
|
198
|
-
getByAttributes: (object) ->
|
198
|
+
getByAttributes: (object,callback) ->
|
199
199
|
if object? and typeof object == 'object' and @any()
|
200
200
|
for member in @collection
|
201
201
|
match = true
|
202
202
|
for key,value of object
|
203
203
|
match = false if member[key]!=value
|
204
|
-
|
204
|
+
if match
|
205
|
+
callback(member) if typeof callback == 'function'
|
206
|
+
return(member)
|
205
207
|
else
|
206
208
|
return null
|
207
209
|
|
@@ -220,9 +222,9 @@ class window.PinkmanCollection extends window.PinkmanCommon
|
|
220
222
|
@getByAttributes(args[0])
|
221
223
|
|
222
224
|
# Desc: find by id
|
223
|
-
find: (id) ->
|
225
|
+
find: (id,callback) ->
|
224
226
|
if id?
|
225
|
-
object = @getBy('id',id)
|
227
|
+
object = @getBy('id',id,callback)
|
226
228
|
return(object)
|
227
229
|
|
228
230
|
# Desc: return the next (after) object
|
@@ -44,10 +44,15 @@ class window.PinkmanCommon
|
|
44
44
|
set: (attr,value, callback = "" ) ->
|
45
45
|
if attr? and value?
|
46
46
|
this[attr] = value
|
47
|
-
callback(this) if typeof callback ==
|
47
|
+
callback(this) if typeof callback == 'function'
|
48
48
|
@reRender() if @_watching
|
49
49
|
return this
|
50
50
|
|
51
|
+
# Desc: sets the attribute as undefined (destroy attribute)
|
52
|
+
unset: (attr,callback) ->
|
53
|
+
this[attr] = null
|
54
|
+
callback(this) if typeof callback == 'function'
|
55
|
+
|
51
56
|
# --- Render related --- #
|
52
57
|
|
53
58
|
render: (options) ->
|
@@ -108,7 +108,8 @@ class window.PinkmanController extends window.PinkmanObject
|
|
108
108
|
options.files(obj,ev.originalEvent.dataTransfer.files) if options.files? and typeof options.files == 'function'
|
109
109
|
|
110
110
|
|
111
|
-
|
111
|
+
isActive: () ->
|
112
|
+
$("##{@id}").length > 0
|
112
113
|
|
113
114
|
# --- controller collection
|
114
115
|
class window.PinkmanControllers extends window.PinkmanCollection
|
data/lib/pinkman/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pinkman
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Agilso Oliveira
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-06-
|
11
|
+
date: 2017-06-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|