Picture_wev8.js
954 Bytes
define("Picture_html",function(){return'<div id="NMEC_${id}" class="wev-comp-${compType}"> <a href="${url}" data-ajax="${dataAjax}" data-reload="true" data-formdata="${queryString}"> <img src="${path}" width="${width}" height="${height}" style="{@if !path}visibility: hidden{@/if}"> </a></div>'}),define(["mUtil","Component","docHelper"],function(a,t,c){return t.init(function(i){t.super(this,i),this.type="Picture",this.tpl=this.type+"_html";var e=this.viewModel={width:"100%",height:200,queryString:"",dataAjax:!0};this.beforeMount=function(){isNaN(e.path)||(e.docid=e.path,e.path="")},this.mounted=function(){e.callback&&a.isFunction(e.callback.click)&&$(".wev-comp-Picture > a",this.$el).on("click",function(){e.callback.click.call(this)});var t=$("img",this.$el);e.docid&&c.convertDocidsToImageIds(e.docid,function(i){i.length&&t.attr("src","/weaver/weaver.file.FileDownload?fileid="+i[i.length-1]),t.css("visibility","visible")})}})});