mirror of
https://github.com/grafana/grafana.git
synced 2024-12-02 13:39:19 -06:00
33 lines
633 B
JavaScript
33 lines
633 B
JavaScript
define([
|
|
'angular',
|
|
],
|
|
function (angular) {
|
|
'use strict';
|
|
|
|
var module = angular.module('grafana.services');
|
|
|
|
module.service('utilSrv', function($rootScope, $modal, $q) {
|
|
|
|
this.init = function() {
|
|
$rootScope.onAppEvent('show-modal', this.showModal);
|
|
};
|
|
|
|
this.showModal = function(e, options) {
|
|
var modal = $modal({
|
|
modalClass: options.modalClass,
|
|
template: options.src,
|
|
persist: false,
|
|
show: false,
|
|
scope: options.scope,
|
|
keyboard: false
|
|
});
|
|
|
|
$q.when(modal).then(function(modalEl) {
|
|
modalEl.modal('show');
|
|
});
|
|
};
|
|
|
|
});
|
|
|
|
});
|