Improved code quality.
parent
e739b784ec
commit
8bdbf31465
|
|
@ -1,3 +1,5 @@
|
||||||
|
/** global: django */
|
||||||
|
|
||||||
if (typeof(django) !== 'undefined' && typeof(django.jQuery) !== 'undefined') {
|
if (typeof(django) !== 'undefined' && typeof(django.jQuery) !== 'undefined') {
|
||||||
(function($) {
|
(function($) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
@ -14,5 +16,5 @@ if (typeof(django) !== 'undefined' && typeof(django.jQuery) !== 'undefined') {
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
})(django.jQuery);
|
}(django.jQuery));
|
||||||
}
|
}
|
||||||
|
|
@ -13,7 +13,7 @@
|
||||||
openerRef = windowRef.parent;
|
openerRef = windowRef.parent;
|
||||||
modalRef = {
|
modalRef = {
|
||||||
name: openerRef.id_to_windowname(widgetName),
|
name: openerRef.id_to_windowname(widgetName),
|
||||||
close: function(){
|
close: function() {
|
||||||
openerRef.dismissRelatedObjectModal();
|
openerRef.dismissRelatedObjectModal();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -49,4 +49,4 @@
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
})();
|
}());
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
/** global: django */
|
||||||
|
|
||||||
if (typeof(django) !== 'undefined' && typeof(django.jQuery) !== 'undefined')
|
if (typeof(django) !== 'undefined' && typeof(django.jQuery) !== 'undefined')
|
||||||
{
|
{
|
||||||
(function($) {
|
(function($) {
|
||||||
|
|
@ -39,7 +41,7 @@ if (typeof(django) !== 'undefined' && typeof(django.jQuery) !== 'undefined')
|
||||||
var linkEl = $(this);
|
var linkEl = $(this);
|
||||||
|
|
||||||
var href = (linkEl.attr('href') || '');
|
var href = (linkEl.attr('href') || '');
|
||||||
if (href == '') {
|
if (href === '') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -99,7 +101,7 @@ if (typeof(django) !== 'undefined' && typeof(django.jQuery) !== 'undefined')
|
||||||
|
|
||||||
// if the current window is inside an iframe, it means that it is already in a modal,
|
// if the current window is inside an iframe, it means that it is already in a modal,
|
||||||
// append an additional css class to the modal to offer more customization
|
// append an additional css class to the modal to offer more customization
|
||||||
if (window.top != window.self) {
|
if (window.top !== window.self) {
|
||||||
iframeInternalModalClass += ' related-modal__nested';
|
iframeInternalModalClass += ' related-modal__nested';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -145,5 +147,5 @@ if (typeof(django) !== 'undefined' && typeof(django.jQuery) !== 'undefined')
|
||||||
presentRelatedObjectModalOnClickOn('a.dynamic_raw_id-related-lookup', true);
|
presentRelatedObjectModalOnClickOn('a.dynamic_raw_id-related-lookup', true);
|
||||||
});
|
});
|
||||||
|
|
||||||
})(django.jQuery);
|
}(django.jQuery));
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue