smart_listing 0.9.7 → 0.9.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e4fcf22c0d95a61711b265aa25f2a270a3f2b7e1
|
|
4
|
+
data.tar.gz: 723a731a8be9bd2b62db1dbf94fe3d2c9b06aeb2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 665a03580d6ee2de1251f25623cac4bcb93ca469ca17a9fd60e81314b73cd7558503813d21a85ae687636ff8af701e009200b095e697e7a2988febad8d555b8d
|
|
7
|
+
data.tar.gz: 28091b9aa284ee8ae36e3e2b1837547231aeeddc3518dce04f320bc5ac416f86725c30971da4168fff89f44ee6391d5443941f87a270230398753ba3d9e3f9e2
|
|
@@ -10,6 +10,7 @@ class SmartListing
|
|
|
10
10
|
@content = @container.find(".<%= SmartListing.config.classes(:content) %>")
|
|
11
11
|
@status = $(".<%= SmartListing.config.classes(:status) %>[data-<%= SmartListing.config.data_attributes(:main) %>='#{@name}']")
|
|
12
12
|
@confirmed = null
|
|
13
|
+
@popovers = {}
|
|
13
14
|
|
|
14
15
|
@container.on 'ajax:before', (e) =>
|
|
15
16
|
@fadeLoading()
|
|
@@ -47,7 +48,7 @@ class SmartListing
|
|
|
47
48
|
# Check if we are confirming the right element
|
|
48
49
|
if(@confirmed != event.currentTarget)
|
|
49
50
|
# We need confirmation
|
|
50
|
-
$.fn.smart_listing.
|
|
51
|
+
$.fn.smart_listing.showConfirmation $(event.currentTarget), $(event.currentTarget).data('<%= SmartListing.config.data_attributes(:confirmation) %>'), (confirm_elem) =>
|
|
51
52
|
@confirmed = confirm_elem[0]
|
|
52
53
|
false
|
|
53
54
|
else
|
|
@@ -55,6 +56,13 @@ class SmartListing
|
|
|
55
56
|
@confirmed = null
|
|
56
57
|
true
|
|
57
58
|
|
|
59
|
+
@container.on 'click', '.<%= SmartListing.config.classes(:item_actions) %> a[data-<%= SmartListing.config.data_attributes(:popover) %>]', (event) =>
|
|
60
|
+
name = $(event.currentTarget).data('<%= SmartListing.config.data_attributes(:popover) %>')
|
|
61
|
+
if jQuery.isFunction(@popovers[name])
|
|
62
|
+
@popovers[name]($(event.currentTarget))
|
|
63
|
+
false
|
|
64
|
+
|
|
65
|
+
|
|
58
66
|
@container.on 'click', 'input[type=text].<%= SmartListing.config.classes(:autoselect) %>', (event) ->
|
|
59
67
|
$(this).select()
|
|
60
68
|
|
|
@@ -135,6 +143,9 @@ class SmartListing
|
|
|
135
143
|
|
|
136
144
|
params: () =>
|
|
137
145
|
@container.data('<%= SmartListing.config.data_attributes(:params) %>')
|
|
146
|
+
|
|
147
|
+
registerPopover: (name, callback) =>
|
|
148
|
+
@popovers[name] = callback
|
|
138
149
|
|
|
139
150
|
#################################################################################################
|
|
140
151
|
# Methods executed by rails UJS:
|
|
@@ -257,7 +268,12 @@ $.fn.smart_listing.observeField = (field, opts = {}) ->
|
|
|
257
268
|
keyChange()
|
|
258
269
|
, 400)
|
|
259
270
|
|
|
260
|
-
$.fn.smart_listing.showPopover = (
|
|
271
|
+
$.fn.smart_listing.showPopover = (elem, body) ->
|
|
272
|
+
elem.popover('destroy')
|
|
273
|
+
elem.popover(content: body, html: true, trigger: 'manual', title: null)
|
|
274
|
+
elem.popover('show')
|
|
275
|
+
|
|
276
|
+
$.fn.smart_listing.showConfirmation = (confirmation_elem, msg, confirm_callback) ->
|
|
261
277
|
buildPopover = (confirmation_elem, msg) ->
|
|
262
278
|
deletion_popover = $('<div/>').addClass('confirmation_box')
|
|
263
279
|
deletion_popover.append($('<p/>').html(msg))
|
|
@@ -265,7 +281,7 @@ $.fn.smart_listing.showPopover = (confirmation_elem, msg, confirm) ->
|
|
|
265
281
|
.append($('<button/>').html('Yes').addClass('btn btn-danger ').click (event) =>
|
|
266
282
|
# set @confirmed element and emulate click on icon
|
|
267
283
|
editable = $(event.currentTarget).closest('.<%= SmartListing.config.classes(:editable) %>')
|
|
268
|
-
|
|
284
|
+
confirm_callback(confirmation_elem)
|
|
269
285
|
$(confirmation_elem).click()
|
|
270
286
|
$(confirmation_elem).popover('destroy')
|
|
271
287
|
)
|
|
@@ -276,9 +292,7 @@ $.fn.smart_listing.showPopover = (confirmation_elem, msg, confirm) ->
|
|
|
276
292
|
)
|
|
277
293
|
)
|
|
278
294
|
|
|
279
|
-
confirmation_elem
|
|
280
|
-
confirmation_elem.popover(content: buildPopover(confirmation_elem, msg), html: true, trigger: 'manual', title: null)
|
|
281
|
-
confirmation_elem.popover('show')
|
|
295
|
+
$.fn.smart_listing.showPopover confirmation_elem, buildPopover(confirmation_elem, msg)
|
|
282
296
|
|
|
283
297
|
$.fn.smart_listing.onLoading = (content, loader) ->
|
|
284
298
|
content.stop(true).fadeTo(500, 0.2)
|
data/lib/smart_listing/config.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: smart_listing
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.9.
|
|
4
|
+
version: 0.9.8
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Sology
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2014-04-
|
|
11
|
+
date: 2014-04-03 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|