Introduce expose view to image widget

- The expose view only be shown if the image widget have href value
This commit is contained in:
Hadi Nategh
2015-01-20 11:56:51 +00:00
parent d3d0edaea3
commit fc5d0cab49
2 changed files with 38 additions and 48 deletions

View File

@ -26,12 +26,12 @@ function expose (widget)
{
return widget.extend([et2_IExposable],{
/**
* Initialize the expose media gallery
*/
init: function() {
this._super.apply(this, arguments);
this.expose_options = {
// The Id, element or querySelector of the gallery widget:
container: '#blueimp-gallery',
@ -168,7 +168,6 @@ function expose (widget)
// Is called with the gallery instance as "this" object:
onclosed: jQuery.proxy(this.expose_onclosed,this)
};
var self = this;
var $body = jQuery('body');
if ($body.find('#blueimp-gallery').length == 0)
{
@ -186,9 +185,12 @@ function expose (widget)
{
this._super.apply(this,arguments)
var self=this;
jQuery(this.node).on('click', function(){
self._init_blueimp_gallery(_value);
if (typeof this.options.expose_view != 'undefined' && this.options.expose_view )
{
jQuery(this.node).on('click', function(){
self._init_blueimp_gallery(_value);
});
}
},
_init_blueimp_gallery: function (_value)