adds check to dialog swiping
This commit is contained in:
@@ -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');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user