From 4eb63d65ecdc85f665b75b357ff0ae817faa7a35 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Tue, 20 Jan 2015 13:14:23 +0000 Subject: [PATCH] Do not bind the expose view click handler if the media type is not supported --- etemplate/js/expose.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/etemplate/js/expose.js b/etemplate/js/expose.js index 1ae763dd2b..8899ce2e4d 100644 --- a/etemplate/js/expose.js +++ b/etemplate/js/expose.js @@ -185,6 +185,11 @@ function expose (widget) { this._super.apply(this,arguments) var self=this; + // If the media type is not supported do not bind the click handler + if (_value && typeof _value.mime != 'undefined' && !_value.mime.match(/^(video|image|audio|media)\//,'ig')) + { + return; + } if (typeof this.options.expose_view != 'undefined' && this.options.expose_view ) { jQuery(this.node).on('click', function(){