Sha256: 83948cfc21f153835dc6425c039958c12cce31414dfa05a5ae63c3ee5c4bdf41
Contents?: true
Size: 1.26 KB
Versions: 5
Compression:
Stored size: 1.26 KB
Contents
/* See license.txt for terms of usage */ define("preview/validationError",["domplate/domplate","core/lib","core/trace","domplate/popupMenu"],function(Domplate,Lib,Trace,Menu){with(Domplate){var ValidationError=domplate({errorTable:TABLE({"class":"errorTable",cellpadding:3,cellspacing:0},TBODY(FOR("error","$errors",TR({"class":"errorRow",_repObject:"$error"},TD({"class":"errorProperty"},SPAN("$error.property")),TD({"class":"errorOptions",$hasTarget:"$error|hasTarget"},DIV({"class":"errorOptionsTarget",onclick:"$onOpenOptions"}," ")),TD(" "),TD({"class":"errorMessage"},SPAN("$error.message")))))),hasTarget:function(e){return e.input&&e.file},onOpenOptions:function(e){var t=Lib.fixEvent(e);Lib.cancelEvent(e);if(!Lib.isLeftClick(e))return;var n=t.target,r=Lib.getAncestorByClass(n,"errorRow"),i=r.repObject;if(!i||!i.input||!i.file)return;var s=this.getMenuItems(i.input,i.file);if(!s.length)return;var o=new Menu({id:"requestContextMenu",items:s});o.showPopup(n)},getMenuItems:function(e,t){var n=[];return Lib.dispatch(this.listeners,"getMenuItems",[n,e,t]),n},listeners:[],addListener:function(e){this.listeners.push(e)},removeListener:function(e){Lib.remove(this.listeners,e)},appendError:function(e,t){e.errors&&this.errorTable.append(e,t)}});return ValidationError}});
Version data entries
5 entries across 5 versions & 1 rubygems