converted confirm_click.js to .ts (#9674)
* converted confirm_click.js to .ts * deleted confirm_click.ts * removed import of confirm_click
This commit is contained in:
committed by
Torkel Ödegaard
parent
afd4f37f39
commit
c3a9a04dad
@@ -1,5 +1,4 @@
|
||||
import "./directives/dash_class";
|
||||
import "./directives/confirm_click";
|
||||
import "./directives/dash_edit_link";
|
||||
import "./directives/dropdown_typeahead";
|
||||
import "./directives/metric_segment";
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
define([
|
||||
'../core_module',
|
||||
],
|
||||
function (coreModule) {
|
||||
'use strict';
|
||||
|
||||
coreModule.default.directive('confirmClick', function() {
|
||||
return {
|
||||
restrict: 'A',
|
||||
link: function(scope, elem, attrs) {
|
||||
elem.bind('click', function() {
|
||||
var message = attrs.confirmation || "Are you sure you want to do that?";
|
||||
if (window.confirm(message)) {
|
||||
var action = attrs.confirmClick;
|
||||
if (action) {
|
||||
scope.$apply(scope.$eval(action));
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
};
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user