diff --git a/media/media/js/mediafield.js b/media/media/js/mediafield.js index d808a4e931a29..541bcc792f40f 100644 --- a/media/media/js/mediafield.js +++ b/media/media/js/mediafield.js @@ -135,8 +135,12 @@ } } else { // Reset tooltip and preview - this.$containerPreview.popover('destroy'); - this.$input.tooltip('destroy'); + try { + this.$containerPreview.popover('destroy'); + this.$input.tooltip('destroy'); + } catch(err) { + // Doing this so that jQueryUI tooltips and popover can exist alongside Bootstrap. + } var value = this.$input.val(); diff --git a/media/media/js/mediafield.min.js b/media/media/js/mediafield.min.js index 301001c4ed58e..df655c04c3710 100644 --- a/media/media/js/mediafield.min.js +++ b/media/media/js/mediafield.min.js @@ -1 +1 @@ -function jInsertFieldValue(a,b){var c=jQuery.noConflict(),d=c("#"+b).val();if(d!=a){var e=c("#"+b);e.val(a),e.trigger("change"),"function"==typeof e.get(0).onchange&&e.get(0).onchange(),jMediaRefreshPreview(b)}}function jMediaRefreshPreview(a){var b=jQuery.noConflict(),c=b("#"+a).val(),d=b("#"+a+"_preview"),e=b("#"+a).data("basepath");d.length&&(c?(d.attr("src",e+c),b("#"+a+"_preview_empty").hide(),b("#"+a+"_preview_img").show()):(d.attr("src",""),b("#"+a+"_preview_empty").show(),b("#"+a+"_preview_img").hide()))}function jMediaRefreshPreviewTip(a){var b=jQuery.noConflict(),c=b(a),d=c.find("img.media-preview");d.each(function(a,d){c.find("div.tip").css("max-width","none");var e=b(this).attr("id");e=e.substring(0,e.length-"_preview".length),jMediaRefreshPreview(e),c.show(this)})}function jMediaRefreshImgpathTip(a,b){var c=jQuery.noConflict(),d=c(a);d.css("max-width","none");var e=c(b).val();c("#TipImgpath").html(e),e.length?d.show():d.hide()}!function(a){"use strict";Function.prototype.bind||(Function.prototype.bind=function(a){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var b=Array.prototype.slice.call(arguments,1),c=this,d=function(){},e=function(){return c.apply(this instanceof d&&a?this:a,b.concat(Array.prototype.slice.call(arguments)))};return d.prototype=this.prototype,e.prototype=new d,e}),a.fieldMedia=function(b,c){this.options=a.extend({},a.fieldMedia.defaults,c),this.$container=a(b),this.$modal=this.$container.find(this.options.modal),this.$modalBody=this.$modal.children(".modal-body"),this.$input=this.$container.find(this.options.input),this.$containerPreview=this.$container.find(this.options.previewContainer),this.$buttonSelect=this.$container.find(this.options.buttonSelect),this.$buttonClear=this.$container.find(this.options.buttonClear),this.$buttonSelect.on("click",this.modalOpen.bind(this)),this.$buttonClear.on("click",this.clearValue.bind(this)),this.$modal.on("hide",this.removeIframe.bind(this)),this.updatePreview()},a.fieldMedia.prototype.modalOpen=function(){var b=a("