no need to set var, just use rjs

v1.18.x
Julian Lam 9 years ago
parent 6470f2ef53
commit ff8fb0e9ab

@ -1,17 +1,13 @@
'use strict'; 'use strict';
/* global bootbox, translator */ /* global bootbox */
var overrides = overrides || {}; var overrides = overrides || {};
if ('undefined' !== typeof window) { if ('undefined' !== typeof window) {
(function ($, undefined) { (function ($, undefined) {
var translator; require(['translator'], function(translator) {
require(['translator'], function(_translator) {
translator = _translator;
});
$.fn.getCursorPosition = function() { $.fn.getCursorPosition = function() {
var el = $(this).get(0); var el = $(this).get(0);
var pos = 0; var pos = 0;
@ -80,7 +76,7 @@ if ('undefined' !== typeof window) {
}); });
}); });
} }
});
})(jQuery || {fn:{}}); })(jQuery || {fn:{}});
(function(){ (function(){
@ -107,15 +103,11 @@ if ('undefined' !== typeof window) {
})(); })();
overrides.overrideBootbox = function () { overrides.overrideBootbox = function () {
require(['translator'], function(translator) {
var dialog = bootbox.dialog, var dialog = bootbox.dialog,
prompt = bootbox.prompt, prompt = bootbox.prompt,
confirm = bootbox.confirm; confirm = bootbox.confirm;
var translator;
require(['translator'], function(_translator) {
translator = _translator;
});
function translate(modal) { function translate(modal) {
var header = modal.find('.modal-header'), var header = modal.find('.modal-header'),
footer = modal.find('.modal-footer'); footer = modal.find('.modal-footer');
@ -144,6 +136,7 @@ if ('undefined' !== typeof window) {
translate(modal); translate(modal);
return modal; return modal;
}; };
});
}; };
overrides.overrideTimeago = function() { overrides.overrideTimeago = function() {

Loading…
Cancel
Save