adds check to dialog swiping

This commit is contained in:
perploug
2013-11-12 10:03:34 +01:00
parent 0ab2b74004
commit f03e9ecebe

View File

@@ -66,7 +66,7 @@ angular.module('umbraco.services')
var scope = options.scope || $rootScope.$new();
//Modal dom obj and unique id
dialog.element = $('<div ng-swipe-right="hide()" data-backdrop="false"></div>');
dialog.element = $('<div ng-swipe-right="swipeHide($event)" data-backdrop="false"></div>');
var id = dialog.template.replace('.html', '').replace('.aspx', '').replace(/[\/|\.|:\&\?\=]/g, "-") + '-' + scope.$id;
if (options.inline) {
@@ -158,6 +158,15 @@ angular.module('umbraco.services')
dialog.element.modal(name);
};
scope.swipeHide = function(e){
if($rootScope.touchDevice){
var selection = window.getSelection();
if(selection.type !== "Range"){
scope.hide();
}
}
};
scope.hide = function() {
dialog.element.modal('hide');