unpoly-rails 0.28.1 → 0.29.0
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.
Potentially problematic release.
This version of unpoly-rails might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +19 -1
- data/dist/unpoly.js +376 -259
- data/dist/unpoly.min.js +3 -3
- data/lib/assets/javascripts/unpoly/browser.js.coffee +2 -2
- data/lib/assets/javascripts/unpoly/bus.js.coffee +40 -13
- data/lib/assets/javascripts/unpoly/flow.js.coffee +9 -9
- data/lib/assets/javascripts/unpoly/form.js.coffee +18 -18
- data/lib/assets/javascripts/unpoly/history.js.coffee +1 -1
- data/lib/assets/javascripts/unpoly/layout.js.coffee +9 -9
- data/lib/assets/javascripts/unpoly/link.js.coffee +34 -24
- data/lib/assets/javascripts/unpoly/modal.js.coffee +38 -37
- data/lib/assets/javascripts/unpoly/motion.js.coffee +20 -23
- data/lib/assets/javascripts/unpoly/navigation.js.coffee +101 -37
- data/lib/assets/javascripts/unpoly/popup.js.coffee +24 -16
- data/lib/assets/javascripts/unpoly/proxy.js.coffee +3 -3
- data/lib/assets/javascripts/unpoly/syntax.js.coffee +29 -37
- data/lib/assets/javascripts/unpoly/tooltip.js.coffee +18 -9
- data/lib/assets/javascripts/unpoly/util.js.coffee +15 -7
- data/lib/unpoly/rails/version.rb +1 -1
- data/spec_app/Gemfile.lock +1 -1
- data/spec_app/spec/javascripts/helpers/trigger.js.coffee +6 -0
- data/spec_app/spec/javascripts/up/bus_spec.js.coffee +9 -8
- data/spec_app/spec/javascripts/up/form_spec.js.coffee +10 -10
- data/spec_app/spec/javascripts/up/link_spec.js.coffee +25 -20
- data/spec_app/spec/javascripts/up/modal_spec.js.coffee +53 -44
- data/spec_app/spec/javascripts/up/navigation_spec.js.coffee +8 -8
- data/spec_app/spec/javascripts/up/popup_spec.js.coffee +92 -44
- data/spec_app/spec/javascripts/up/tooltip_spec.js.coffee +46 -4
- metadata +2 -2
@@ -117,7 +117,49 @@ describe 'up.tooltip', ->
|
|
117
117
|
|
118
118
|
it 'should have tests'
|
119
119
|
|
120
|
-
describe 'body', ->
|
121
|
-
|
122
|
-
|
123
|
-
|
120
|
+
describe 'when clicking on the body', ->
|
121
|
+
|
122
|
+
beforeEach ->
|
123
|
+
up.motion.config.enabled = false
|
124
|
+
|
125
|
+
it 'closes the tooltip', (done) ->
|
126
|
+
$link = affix('.link')
|
127
|
+
up.tooltip.attach($link, text: 'Tooltip text')
|
128
|
+
expect(up.tooltip.isOpen()).toBe(true)
|
129
|
+
Trigger.clickSequence($('body'))
|
130
|
+
u.nextFrame ->
|
131
|
+
expect(up.tooltip.isOpen()).toBe(false)
|
132
|
+
done()
|
133
|
+
|
134
|
+
it 'closes the tooltip when a an [up-instant] link removes its parent (and thus a click event never bubbles up to the document)', (done) ->
|
135
|
+
$parent = affix('.parent')
|
136
|
+
$parentReplacingLink = $parent.affix('a[href="/foo"][up-target=".parent"][up-instant]')
|
137
|
+
$tooltipOpener = affix('.link')
|
138
|
+
up.tooltip.attach($tooltipOpener, text: 'Tooltip text')
|
139
|
+
expect(up.tooltip.isOpen()).toBe(true)
|
140
|
+
Trigger.clickSequence($parentReplacingLink)
|
141
|
+
u.nextFrame ->
|
142
|
+
expect(up.tooltip.isOpen()).toBe(false)
|
143
|
+
done()
|
144
|
+
|
145
|
+
it 'closes a tooltip when the user clicks on an [up-target] link outside the tooltip', (done) ->
|
146
|
+
$target = affix('.target')
|
147
|
+
$outsideLink = affix('a[href="/foo"][up-target=".target"]')
|
148
|
+
$tooltipOpener = affix('.link')
|
149
|
+
up.tooltip.attach($tooltipOpener, text: 'Tooltip text')
|
150
|
+
expect(up.tooltip.isOpen()).toBe(true)
|
151
|
+
Trigger.clickSequence($outsideLink)
|
152
|
+
u.nextFrame ->
|
153
|
+
expect(up.tooltip.isOpen()).toBe(false)
|
154
|
+
done()
|
155
|
+
|
156
|
+
it 'closes a tooltip when the user clicks on an [up-instant] link outside the tooltip', (done) ->
|
157
|
+
$target = affix('.target')
|
158
|
+
$outsideLink = affix('a[href="/foo"][up-target=".target"][up-instant]')
|
159
|
+
$tooltipOpener = affix('.link')
|
160
|
+
up.tooltip.attach($tooltipOpener, text: 'Tooltip text')
|
161
|
+
expect(up.tooltip.isOpen()).toBe(true)
|
162
|
+
Trigger.clickSequence($outsideLink)
|
163
|
+
u.nextFrame ->
|
164
|
+
expect(up.tooltip.isOpen()).toBe(false)
|
165
|
+
done()
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unpoly-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.29.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henning Koch
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-08-
|
11
|
+
date: 2016-08-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|