X-Git-Url: http://git.ithinksw.org/philo.git/blobdiff_plain/a47d033050dd245899d82b11da731a0de551264b..759d24d246282fe358a867b4f98fed36308c9a30:/philo/static/philo/js/EmbedWidget.js diff --git a/philo/static/philo/js/EmbedWidget.js b/philo/static/philo/js/EmbedWidget.js index 210bb9a..f946740 100644 --- a/philo/static/philo/js/EmbedWidget.js +++ b/philo/static/philo/js/EmbedWidget.js @@ -40,6 +40,23 @@ // otherwise, do what you usually do oldDismissRelatedLookupPopup.apply(this, arguments); } + + // overload the dismissAddAnotherPopup function + oldDismissAddAnotherPopup = window.dismissAddAnotherPopup; + window.dismissAddAnotherPopup = function (win, newId, newRepr) { + var name = windowname_to_id(win.name), + elem = $('#'+win.name), val; + if (elem.parent().hasClass('embed-widget')) { + dismissRelatedLookupPopup(win, newId); + } + // otherwise, do what you usually do + oldDismissAddAnotherPopup.apply(this, arguments); + } + + // Add grappelli to the body class if the admin is grappelli. This will allow us to customize styles accordingly. + if (window.grappelli) { + $(document.body).addClass('grappelli'); + } }, parseContentTypes: function () { var string = widget.EmbedFields.eq(0).attr('data-content-types'),