carte-server 1.0.6 → 1.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/carte/client/views/slideshow.cjsx +16 -4
- data/package.json +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d81ce3e8c26a94618aac1527f475ba4a8fae8a7a
|
4
|
+
data.tar.gz: c555caad49ebb424cd41bcd65a2328cab83d3374
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 820d0748a05bc04fcfd3aa45d48c85cf71799157ae7996b0c13aa07c72762bc1ea6ddeef8ee63de61a9a012f364bb38e72ad4c58e4a8e0680e07c25fe7c6b2b2
|
7
|
+
data.tar.gz: 62f67eb92f36ffcccfc4f92b87f18e3e8b0604c4d9f2399367e118a8ce18f3f42406c404e5a500be33f325e4e7a6a0677bf2e28e2cf5762d7c4daea8d1db2b72
|
@@ -14,11 +14,13 @@ Button = require('react-bootstrap').Button
|
|
14
14
|
window.onerror = (error, url, line) -> alert error
|
15
15
|
|
16
16
|
Flash = React.createClass
|
17
|
+
scrollEventNames: ['touchstart', 'touchmove', 'touchend', 'gesturestart', 'gesturechange', 'gestureend']
|
18
|
+
|
17
19
|
componentDidMount: ->
|
18
20
|
console.log '[views/flash] componentDidMount', @props
|
19
21
|
$(document).on 'keydown', @onKeyDown
|
20
|
-
|
21
|
-
|
22
|
+
for eventName in @scrollEventNames
|
23
|
+
$(document).on eventName, @preventScroll
|
22
24
|
|
23
25
|
@setState currCards: @props.cards
|
24
26
|
|
@@ -37,6 +39,8 @@ Flash = React.createClass
|
|
37
39
|
componentWillUnmount: ->
|
38
40
|
console.log '[views/flash] FlashMain componentWillUnmount'
|
39
41
|
$(document).off 'keydown', @onKeyDown
|
42
|
+
for eventName in @scrollEventNames
|
43
|
+
$(document).off eventName, @preventScroll
|
40
44
|
|
41
45
|
onKeyDown: (event)->
|
42
46
|
switch event.keyCode
|
@@ -44,6 +48,11 @@ Flash = React.createClass
|
|
44
48
|
when 37 then @onClickPrev()
|
45
49
|
when 39 then @onClickNext()
|
46
50
|
|
51
|
+
preventScroll: (event)->
|
52
|
+
tagName = event.target.tagName.toLowerCase()
|
53
|
+
return if tagName == 'button' || tagName == 'a'
|
54
|
+
event.preventDefault()
|
55
|
+
|
47
56
|
getInitialState: ->
|
48
57
|
currCard: null
|
49
58
|
currCards: null
|
@@ -186,6 +195,9 @@ Flash = React.createClass
|
|
186
195
|
onClickMenuItem: (params)->
|
187
196
|
()=> window.location.hash = '#/?' + @queryParam(params)
|
188
197
|
|
198
|
+
onTouchStartTools: (event)->
|
199
|
+
event.stopPropagation()
|
200
|
+
|
189
201
|
render: ->
|
190
202
|
clearInterval @interval if @interval
|
191
203
|
if @props.cards.query.auto != 'off'
|
@@ -194,10 +206,9 @@ Flash = React.createClass
|
|
194
206
|
when 'fast' then bpm = 90
|
195
207
|
when 'normal' then bpm = 60
|
196
208
|
when 'slow' then bpm = 30
|
197
|
-
console.log 'bpm!!!!!!!!!!!!!!!!!!!!!!!!!!', bpm
|
198
209
|
@interval = setInterval @onClickNext, 1000 * 60 / bpm
|
199
210
|
<div onTouchStart={@onTouchStart} onTouchMove={@onTouchMove} onTouchEnd={@onTouchEnd} style={overflow:'hidden',width:'100%',height:'100%'}>
|
200
|
-
<div style={position:'absolute',bottom:0,width:'100%',padding:'47px 0px 0px 0px'} onMouseOver={@onMouseOverTools} onMouseLeave={@onMouseLeaveTools}>
|
211
|
+
<div onTouchStart={@onTouchStartTools} style={position:'absolute',bottom:0,width:'100%',padding:'47px 0px 0px 0px'} onMouseOver={@onMouseOverTools} onMouseLeave={@onMouseLeaveTools}>
|
201
212
|
<span className={classnames("pull-right":true, 'carte-hidden': !@state.showTools)}>
|
202
213
|
<ButtonGroup>
|
203
214
|
<DropdownButton bsSize='large' bsStyle='default' title={'Auto: ' + @props.cards.query.auto} dropup pullRight className={classnames('open': @state.menuOpen)}>
|
@@ -265,6 +276,7 @@ module.exports = React.createClass
|
|
265
276
|
|
266
277
|
componentWillUnmount: ->
|
267
278
|
console.log '[views/slideshow] componentWillUnmount'
|
279
|
+
React.unmountComponentAtNode(@node)
|
268
280
|
document.body.removeChild(@node)
|
269
281
|
|
270
282
|
renderSlideshow: ->
|
data/package.json
CHANGED