﻿var __extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},CZ;(function(n){(function(t){var r=function(n){function t(t,r,u){var e={context:u,sortableSettings:{forcePlaceholderSize:!0,cursor:"move",placeholder:"cz-listbox-placeholder",revert:100,opacity:.75,tolerance:"pointer",scroll:!1,start:function(n,t){t.placeholder.height(t.item.height())}}},f={"default":{container:r,uiMap:{closeButton:".cz-listitem-close-btn",iconImg:".cz-form-tour-contentitem-listitem-icon > img",titleTextblock:".cz-contentitem-listitem-title",typeTextblock:".cz-contentitem-listitem-highlighted"}}};f.default.ctor=i;n.call(this,t,e,f)}return __extends(t,n),t}(t.ListboxBase),i;t.TourStopListbox=r;i=function(t){function i(i,r,u,f){var s,o;t.call(this,i,r,u,f);this.iconImg=this.container.find(u.iconImg);this.titleTextblock=this.container.find(u.titleTextblock);this.typeTextblock=this.container.find(u.typeTextblock);var e=this,h=this.container.find(".cz-tourstop-lapse"),c=this.container.find(".cz-tourstop-description");h.val(e.data.lapseTime);c.text(e.data.Description);h.change(function(){e.data.lapseTime=e.LapseTime});c.change(function(){e.data.Description=e.Description});s=this.data.ThumbnailUrl;o=new Image;o.onload=function(){e.iconImg.replaceWith(o)};o.onerror=function(){console&&console.warn&&console.warn("Could not load a thumbnail image "+s)};o.src=s;this.titleTextblock.text(this.data.Title);this.typeTextblock.text(this.data.Type);this.Activate();this.container.click(function(){e.Activate()});this.container.dblclick(function(){if(typeof f.Target.vc!="undefined"){var t=f.Target.vc.getViewport(),i=n.VCContent.getVisibleForElement(f.Target,1,t,!0),r={newvisible:i,element:f.Target};n.Search.navigateToElement(r)}})}return __extends(i,t),Object.defineProperty(i.prototype,"LapseTime",{get:function(){var t=this.container.find(".cz-tourstop-lapse"),n=parseInt("0"+t.val());return n>3600&&(n=3600),n},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"Description",{get:function(){var n=this.container.find(".cz-tourstop-description");return n.val()},enumerable:!0,configurable:!0}),i.prototype.Activate=function(){var n=this.container.find(".cz-tourstop-detailblock");this.parent.container.find(".cz-tourstop-detailblock").not(n).hide();n.show(500).find(".cz-tourstop-lapse").autoNumeric("destroy").autoNumeric("init")},i}(t.ListItemBase);t.TourStopListItem=i})(n.UI||(n.UI={}));var t=n.UI})(CZ||(CZ={}));
/*
//# sourceMappingURL=tourstop-listbox.min.js.map
*/