Skip to content

Commit

Permalink
chore: Release version v1.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jtrussell committed Jun 19, 2014
1 parent 273f453 commit 73e218d
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 25 deletions.
55 changes: 45 additions & 10 deletions angular-snap.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
angular.module('snap', []);


(function() {
'use strict';
var version = [1, 5, 0]
var version = [1, 5, 1]
, vObj = {
full: version.join('.'),
major: version[0],
Expand All @@ -11,7 +11,7 @@ angular.module('snap', []);
};
angular.module('snap').constant('SNAP_VERSION', vObj);
}());


angular.module('snap')
.directive('snapClose', ['$rootScope', 'snapRemote', function($rootScope, snapRemote) {
'use strict';
Expand All @@ -26,7 +26,7 @@ angular.module('snap')
}
};
}]);


angular.module('snap')
.directive('snapContent', ['SnapConstructor', 'snapRemote', function (SnapConstructor, snapRemote) {
'use strict';
Expand Down Expand Up @@ -68,7 +68,7 @@ angular.module('snap')
}
};
}]);


angular.module('snap')
.directive('snapDragger', ['snapRemote', function(snapRemote) {
'use strict';
Expand All @@ -85,7 +85,7 @@ angular.module('snap')
};
}]);



angular.module('snap')
.directive('snapDrawer', function () {
'use strict';
Expand Down Expand Up @@ -119,7 +119,7 @@ angular.module('snap')
}
};
});


angular.module('snap')
.directive('snapDrawers', function () {
'use strict';
Expand All @@ -131,7 +131,7 @@ angular.module('snap')
};
});



angular.module('snap')
.directive('snapToggle', ['$rootScope', 'snapRemote', function($rootScope, snapRemote) {
'use strict';
Expand All @@ -145,14 +145,49 @@ angular.module('snap')
snapId = scope.$eval(snapId);
}

/**
* Stifle mousedown and mouseup events by default
*
* See issue #61
*
* mousedown can create a race condition with the Snap.js `tapToClose`
* setting, the `tapToClose` handler runs first (if drawer is open)
* then our toggle handler runs. Depending on how far along in the
* close animation the drawer is when the toggle handler runs we may
* end up keeping the drawer open (i.e. a quick open/close) or *only*
* performing a double close.
*
* The situation is trickier because we want to allow mouseup events
* to flow through **if** the corresponding mousedown event did not
* target out toggle button... otherwise you could get stuck in a
* drag. We have a naive approach to preventing this... you can still
* get stuck in drag temporarily if you: mouse down on the toggle
* button, then mouse up off screen, then start a drag, then mouse
* down on the toggle button.
*/
if(!attrs.snapUnsafe) {
var downOnMe = false;
element.bind('mousedown', function(event) {
downOnMe = true;
event.stopImmediatePropagation();
});

element.bind('mouseup', function(event) {
if(downOnMe) {
event.stopImmediatePropagation();
}
downOnMe = false;
});
}

element.bind('click', function() {
snapRemote.toggle(snapSide, snapId);
$rootScope.$digest();
});
}
};
}]);


angular.module('snap')
.provider('SnapConstructor', function() {
'use strict';
Expand All @@ -167,7 +202,7 @@ angular.module('snap')
};
});



angular.module('snap')
.provider('snapRemote', function SnapRemoteProvider() {
'use strict';
Expand Down
2 changes: 1 addition & 1 deletion angular-snap.min.js

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

28 changes: 14 additions & 14 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "angular-snap",
"version": "1.5.0",
"main": [
"angular-snap.js",
"angular-snap.css"
],
"ignore": [
"README.md"
],
"dependencies": {
"angular": "~1.2.4",
"snapjs": "latest"
}
{
"name": "angular-snap",
"version": "1.5.1",
"main": [
"angular-snap.js",
"angular-snap.css"
],
"ignore": [
"README.md"
],
"dependencies": {
"angular": "~1.2.4",
"snapjs": "latest"
}
}

0 comments on commit 73e218d

Please sign in to comment.