diff --git a/hourglass/client/mobile/mobile.css b/hourglass/client/mobile/mobile.css index e3610ca..6aad343 100644 --- a/hourglass/client/mobile/mobile.css +++ b/hourglass/client/mobile/mobile.css @@ -276,4 +276,8 @@ line-height: 13vw; display: table-cell; vertical-align: middle; +} + +#mTypeFilterWrapper { + margin-top: 0; } \ No newline at end of file diff --git a/hourglass/client/mobile/mobile.html b/hourglass/client/mobile/mobile.html index d163594..f89baa8 100644 --- a/hourglass/client/mobile/mobile.html +++ b/hourglass/client/mobile/mobile.html @@ -43,18 +43,18 @@

Filters

-
+

By Type

-
+
{{#each types}} {{> mSideTypeFilter}} {{/each}}
-
+

By Class

-
+
{{#each myClasses}} {{> mSidebarClasses}} {{/each}} diff --git a/hourglass/client/mobile/mobile.js b/hourglass/client/mobile/mobile.js index 52d7ea3..87b8ab0 100644 --- a/hourglass/client/mobile/mobile.js +++ b/hourglass/client/mobile/mobile.js @@ -102,7 +102,6 @@ function addListeners() { new Hammer($(".mobileClass")[i], { domEvents: true }); - $(".mobileClass[workid="+id+"]").on('panmove', function(e) { var dX = deltaX + (e.originalEvent.gesture.deltaX); if(dX < 0) { @@ -186,7 +185,8 @@ function addMobileButton(element, lighten, thisFunction) { backgroundColorBlue: colors[2] + add, },100); }); - button.on('pressup', function(e) { + + ele.bind('touchend', function(e) { ele.velocity("stop"); ele.velocity( { @@ -206,19 +206,36 @@ function addMobileSideButton(element, lighten, thisFunction) { let add = lighten; let ele = jQuery(element); let execute = thisFunction; + let care = true; + let colors = parseFloat($.Velocity.hook(ele, "backgroundColorAlpha")); + var press = new Hammer.Press({ event: 'press', pointers: 1, - time: 0.01, - threshold: 3000 + time: 0.01 }); + + var pan = new Hammer.Pan(); + button.add(press); + button.add(pan); button.on('press', function(e) { + care = true; ele.velocity({backgroundColorAlpha: colors + add},100); }); - button.on('pressup', function(e) { + + button.on('pan', function(e) { + if(element !== document.elementFromPoint(e.pX, e.pY)) { + care = false; + ele.velocity("stop"); + ele.velocity({backgroundColorAlpha: colors}, 200); + } + }); + + ele.bind('touchend', function(e) { + if(!care) return; ele.velocity("stop"); ele.velocity( {