clipboard-rails 1.5.1 → 1.5.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/clipboard/rails/version.rb +1 -1
- data/vendor/assets/javascripts/clipboard.js +15 -12
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 770b1fd6c1b179dd51d7a970b984447e3711ada7
|
4
|
+
data.tar.gz: e38af34f32775f6c4a4a045a1cf5f0a0928d7173
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8678a124215bbfc16158120b0a1c6fab516550f81a1acc12933424b8b9ea5d782a1590dc1c77bf514c9eede5bbb7aad3dc562b5dda5b3425599efc7eb943d93e
|
7
|
+
data.tar.gz: 61009f1be5ad470a8bcda471476c1945e95f77340cf0502ac2835a83f9f094af7501fc0801e5859a207dae137fbbf779186ea950f9559dad152cb02b301a2604
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* clipboard.js v1.5.
|
2
|
+
* clipboard.js v1.5.5
|
3
3
|
* https://zenorocha.github.io/clipboard.js
|
4
4
|
*
|
5
5
|
* Licensed MIT © Zeno Rocha
|
@@ -92,13 +92,9 @@ function delegate(element, selector, type, callback) {
|
|
92
92
|
*/
|
93
93
|
function listener(element, selector, type, callback) {
|
94
94
|
return function(e) {
|
95
|
-
|
96
|
-
|
97
|
-
if (delegateTarget) {
|
98
|
-
Object.defineProperty(e, 'target', {
|
99
|
-
value: delegateTarget
|
100
|
-
});
|
95
|
+
e.delegateTarget = closest(e.target, selector, true);
|
101
96
|
|
97
|
+
if (e.delegateTarget) {
|
102
98
|
callback.call(element, e);
|
103
99
|
}
|
104
100
|
}
|
@@ -259,11 +255,16 @@ function select(element) {
|
|
259
255
|
var selectedText;
|
260
256
|
|
261
257
|
if (element.nodeName === 'INPUT' || element.nodeName === 'TEXTAREA') {
|
262
|
-
element.
|
258
|
+
element.focus();
|
259
|
+
element.setSelectionRange(0, element.value.length);
|
263
260
|
|
264
261
|
selectedText = element.value;
|
265
262
|
}
|
266
263
|
else {
|
264
|
+
if (element.hasAttribute('contenteditable')) {
|
265
|
+
element.focus();
|
266
|
+
}
|
267
|
+
|
267
268
|
var selection = window.getSelection();
|
268
269
|
var range = document.createRange();
|
269
270
|
|
@@ -665,15 +666,17 @@ var Clipboard = (function (_Emitter) {
|
|
665
666
|
*/
|
666
667
|
|
667
668
|
Clipboard.prototype.onClick = function onClick(e) {
|
669
|
+
var trigger = e.delegateTarget || e.currentTarget;
|
670
|
+
|
668
671
|
if (this.clipboardAction) {
|
669
672
|
this.clipboardAction = null;
|
670
673
|
}
|
671
674
|
|
672
675
|
this.clipboardAction = new _clipboardAction2['default']({
|
673
|
-
action: this.action(
|
674
|
-
target: this.target(
|
675
|
-
text: this.text(
|
676
|
-
trigger:
|
676
|
+
action: this.action(trigger),
|
677
|
+
target: this.target(trigger),
|
678
|
+
text: this.text(trigger),
|
679
|
+
trigger: trigger,
|
677
680
|
emitter: this
|
678
681
|
});
|
679
682
|
};
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: clipboard-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mohammed Sadiq
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-11-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|