Skip to content

Commit

Permalink
Added once parameter to skyline
Browse files Browse the repository at this point in the history
  • Loading branch information
maxmert committed Jun 11, 2014
1 parent c092419 commit 8fcfd3d
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 9 deletions.
8 changes: 6 additions & 2 deletions coffee/skyline.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ class Skyline extends MaxmertkitHelpers
# Number or function, returning Number; in ms, delay before start animation
delay: @el.getAttribute( 'data-delay' ) or 300

# Boolean; show only once and don't hide after that
once: @el.getAttribute( 'data-once' ) or no

# Boolean; on spying on mobile devices
onMobile: @el.getAttribute( 'data-on-mobile' ) or no

Expand Down Expand Up @@ -104,6 +107,7 @@ class Skyline extends MaxmertkitHelpers
@_addClass '-start--'
@_removeClass '-stop--'
@active = yes
if @options.once then @stop()
, delay

deactivate: ->
Expand All @@ -116,7 +120,7 @@ class Skyline extends MaxmertkitHelpers

refresh: ->
_windowSize = _getWindowSize()
@spyParams =
@spyParams =
offset: @_getPosition @el
height: @_outerHeight()

Expand Down Expand Up @@ -268,4 +272,4 @@ if Element? then Element::skyline = window['mkitSkyline']
if jQuery?
$.fn[_name] = (options) ->
@each ->
window['mkitSkyline'].call( @, options )
window['mkitSkyline'].call( @, options )
4 changes: 2 additions & 2 deletions docs/js/app.js

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion docs/js/maxmertkit.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/js/templates.js

Large diffs are not rendered by default.

9 changes: 8 additions & 1 deletion docs/templates/kit/components/skyline.html
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,13 @@ <h2>Properties</h2>
<code>Number</code> or <code>Function</code>, returning number. Delay before showing.
</td>
</tr>
<tr>
<td>once</td>
<td><i>@el.getAttribute( 'data-once' ) or no</i></td>
<td class="_hidden-phones_ _hidden-tablets_">
<code>Boolean</code>, show just once and don't hide element anymore.
</td>
</tr>
<tr>
<td>onMobile</td>
<td><i>@el.getAttribute( 'data-on-mobile' ) or no</i></td>
Expand Down Expand Up @@ -290,4 +297,4 @@ <h2>Events</h2>
</td>
</tr>
</tbody>
</table>
</table>
6 changes: 5 additions & 1 deletion js/maxmertkit.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sass/widgets/alerts/common/_themes.sass
Original file line number Diff line number Diff line change
@@ -1 +1 @@
$themes: ( default primary error info warning dark )
$themes: ( default primary error info warning dark )

0 comments on commit 8fcfd3d

Please sign in to comment.