pinkman 0.9.2.1 → 0.9.2.2
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: a04611854a37be10d7caac33264a04bcd99dfc6d
|
4
|
+
data.tar.gz: 5e901f8d7288c7378fcfb54cedab7c45086a19b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b6ca4cc0aad79f1d8d31fa8c3e687ab539504eb431c9148e0540657d539c9c9ce8948657f25f88c792b75649323db8aa8cffcf2b7b7df62fd1ff002b683a241e
|
7
|
+
data.tar.gz: 602677e45e8da98e3a43231d43ba4d9f3ff7e1b60ddba6bb504dc9c2e738a248c69b817dddf92a3673d0317175486b697f313da2fd83360a637e1a565f484e58
|
@@ -78,9 +78,13 @@ class window.PinkmanCommon
|
|
78
78
|
newOptions[k] = v if k != 'target' and k != 'callback'
|
79
79
|
newOptions.reRender = no
|
80
80
|
target = options.target
|
81
|
+
wrapIn = options.wrapIn
|
81
82
|
newOptions.object = this
|
82
83
|
newOptions.callback = (object,content) ->
|
83
|
-
|
84
|
+
if wrapIn?
|
85
|
+
$('#'+target).append("<div class='#{wrapIn}'>#{content}</div>")
|
86
|
+
else
|
87
|
+
$('#'+target).append(content)
|
84
88
|
options.callback(object,content) if options.callback? and typeof options.callback == 'function'
|
85
89
|
Pinkman.render(newOptions)
|
86
90
|
|
@@ -27,7 +27,7 @@ class window.PinkmanController extends window.PinkmanObject
|
|
27
27
|
build: ->
|
28
28
|
if @builder? and typeof @builder == 'function'
|
29
29
|
@builder(this)
|
30
|
-
@main() if @main? and typeof @main == 'function'
|
30
|
+
@main() if @main? and $("##{@id}").length and typeof @main == 'function'
|
31
31
|
return(true)
|
32
32
|
else
|
33
33
|
return(false)
|
@@ -51,33 +51,36 @@ class window.PinkmanController extends window.PinkmanObject
|
|
51
51
|
@bindIndividually(attribute,callback)
|
52
52
|
|
53
53
|
bindIndividually: (attribute,callback='') ->
|
54
|
-
|
55
|
-
|
56
|
-
obj
|
57
|
-
|
54
|
+
if $("##{@id}").length
|
55
|
+
@action attribute, ['keyup','change'], (obj,jquery,args...) ->
|
56
|
+
if obj[attribute] != jquery.val()
|
57
|
+
obj.set(attribute,jquery.val())
|
58
|
+
callback(obj,jquery,args...) if callback? and typeof callback == 'function'
|
58
59
|
|
59
60
|
# bindAll: ->
|
60
61
|
|
61
62
|
bottom: (callback) ->
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
Pinkman.
|
69
|
-
|
70
|
-
|
71
|
-
|
63
|
+
if $("##{@id}").length
|
64
|
+
setTimeout ->
|
65
|
+
Pinkman._lastEndOfPage = 0 unless Pinkman._lastEndOfPage?
|
66
|
+
$(window).scroll ->
|
67
|
+
t = Date.now()
|
68
|
+
distanceFromBottom = $(document).height() - $(window).scrollTop() - document.body.offsetHeight
|
69
|
+
if ( (distanceFromBottom < Pinkman.bottomDistance and Pinkman._lastEndOfPage < t) or distanceFromBottom == 0 ) and not Pinkman._bottomTriggered
|
70
|
+
Pinkman._bottomTriggered = true
|
71
|
+
Pinkman._lastEndOfPage = t
|
72
|
+
callback()
|
73
|
+
, 50
|
72
74
|
|
73
75
|
endBottom: () ->
|
74
76
|
Pinkman._bottomTriggered = false
|
75
77
|
|
76
78
|
scrolling: (callback) ->
|
77
|
-
$(
|
78
|
-
|
79
|
-
Pinkman._stopScroll
|
80
|
-
|
79
|
+
if $("##{@id}").length
|
80
|
+
$(window).scroll ->
|
81
|
+
unless Pinkman._stopScroll
|
82
|
+
Pinkman._stopScroll = yes
|
83
|
+
callback(window.scrollY)
|
81
84
|
|
82
85
|
endScroll: ->
|
83
86
|
Pinkman._stopScroll = no
|
@@ -134,7 +137,7 @@ class window.PinkmanAction extends window.PinkmanObject
|
|
134
137
|
|
135
138
|
# Desc: attaches one single event
|
136
139
|
attach: (eventName) ->
|
137
|
-
if Pinkman.isString(eventName)
|
140
|
+
if Pinkman.isString(eventName) and $("##{@controller.id}").length
|
138
141
|
action = this
|
139
142
|
$('body').on eventName, action.selector, (ev) ->
|
140
143
|
ev.preventDefault() unless eventName == 'keypress'
|
@@ -164,7 +167,7 @@ Pinkman.controllers.isActive = (id) ->
|
|
164
167
|
|
165
168
|
Pinkman.controllers.def = (id,builder) ->
|
166
169
|
$(document).ready ->
|
167
|
-
if id? and builder?
|
170
|
+
if id? and builder?
|
168
171
|
c = new PinkmanController(id: id, builder: builder)
|
169
172
|
Pinkman.controllers.push(c)
|
170
173
|
return(c.build())
|
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.2.
|
4
|
+
version: 0.9.2.2
|
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-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|