Add touch events

This commit is contained in:
2014-12-16 22:14:47 +01:00
parent 9b72ff173f
commit 6a8d517727
14 changed files with 2140 additions and 53 deletions
@@ -1,4 +1,4 @@
Ember.Handlebars.registerHelper 't', (path, params..., options)->
Ember.Handlebars.helper 't', (path, params..., options)->
text = t(path)
tag = if options.hash.bare then text else "<span data-t='#{path}' data-t-attributes='{}'>#{text}</span>"
new Handlebars.SafeString tag
tag.htmlSafe()
@@ -1,4 +1,5 @@
#= require_self
#= require jquery.touchSwipe
#= require handlebars
#= require ember
#= require ember-data
@@ -1,5 +1,4 @@
header.top-menu
.toggle-side-menu: span
.top-menu
.top-menu-bar
.menu-content
section.main-buttons
@@ -30,7 +29,8 @@ header.top-menu
.counter.supplier-orders-in-process-count
= list.supplier.orders_in_process_count
span.orders-in-process-count-icon
aside.side-menu
.side-menu
.toggle-side-menu: span
ul
li.title: h3 Menu
li
@@ -69,7 +69,7 @@ aside.side-menu
a{action "openDebugger"}
span.fa.fa-wrench.fa-lg
span Debugger
main.main-section
.main-section
.main-section-content
if notice
#notice.alert-box{action "clearNotice"} data-alert=true
@@ -1,13 +1,16 @@
App.ApplicationView = Ember.View.extend
didInsertElement: ->
$('.main-section').css 'min-height', $(window).height() - $('.top-menu').outerHeight()
$('.toggle-side-menu,.side-menu').click ->
menu = $('aside.side-menu')
toggle = $('.toggle-side-menu')
if menu.is(':visible')
menu.animate left: -255, -> $(@).hide()
toggle.animate left: 0, -> $(@).removeClass('open')
else
menu.show().animate left: 0
toggle.animate left: 222 - 30, -> $(@).addClass('open')
# Side menu collapsing
targets = @$('.side-menu')
targets.addClass('closed').click -> targets.toggleClass('active').addClass('clicked').toggleClass('closed')
controller = @get('controller')
@$('.main-section').swipe
swipe: (event, direction, distance, duration, fingerCount) ->
if fingerCount is 2
if direction is "right"
targets.addClass('active clicked').removeClass('closed')
if direction is "left"
targets.removeClass('active').addClass('closed')
if fingerCount is 3 and direction is "up"
controller.transitionToRoute "settings"
fingers: 'all'
@@ -3,13 +3,7 @@
#= require faye
#= require moment
#= require translations
#= require_directory .
#= require_self
#
# (($) ->
# origAppend = $.fn.append
# $.fn.append = -> origAppend.apply(@, arguments).trigger("append")
# )(jQuery)
@Qstorage = localStorage