Sha256: ccffa2c76744aa214f98f302b422a6f893cf2cf70b9c27dda20be4d1b9ef3ff5

Contents?: true

Size: 1.57 KB

Versions: 3

Compression:

Stored size: 1.57 KB

Contents

/*!
 * UI development toolkit for HTML5 (OpenUI5)
 * (c) Copyright 2009-2018 SAP SE or an SAP affiliate company.
 * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
 */
sap.ui.define(['./library','./SliderUtilities','sap/ui/core/Element'],function(l,S,E){"use strict";var a=E.extend("sap.m.ResponsiveScale",{metadata:{interfaces:["sap.m.IScale"],library:"sap.m",properties:{tickmarksBetweenLabels:{type:"int",group:"Appearance",defaultValue:0}}}});a.prototype.calcNumberOfTickmarks=function(s,f,t){var m=Math.floor(s/f)+1;m=t&&(m>t)?this._runStepsOptimization(t,m-1):m;return Math.floor(m);};a.prototype._runStepsOptimization=function(t,m){var s=m/t;while((t>1)&&(s%1!==0)){t--;s=m/t;}return t;};a.prototype.getHiddenTickmarksLabels=function(s,t,o,L){var j,c,h=new Array(t),i=Math.ceil(1/(o/L)),C=function(p){return p<<1;};if(i===1){return h;}i--;i|=i>>1;i|=i>>2;i|=i>>4;i|=i>>8;i|=i>>16;i++;i=i>>1;j=C(i);while(i){c=i;while(c<((t/2)+j)){h[c]=true;h[t-c-1]=true;c+=j;}i=i>>1;j=C(i);}return h;};a.prototype.handleResize=function(e){var L,o,O,h,s,$=e.control.$(),t=$.find(".sapMSliderTick"),i=$.find(".sapMSliderTickmarks").width(),b=(i/t.size())>=S.CONSTANTS.TICKMARKS.MIN_SIZE.SMALL;t.css("visibility",b?'':'hidden');L=$.find(".sapMSliderTickLabel");o=parseFloat(L[1].style.left);O=i*o/100;h=this.getHiddenTickmarksLabels(i,L.size(),O,S.CONSTANTS.TICKMARKS.MIN_SIZE.WITH_LABEL);L.each(function(I,c){s=c.nextSibling||c.previousSibling||{style:{visibility:null}};if(h[I]&&!b){c.style.display="none";s.style.visibility='hidden';}else{c.style.display="";s.style.visibility='';}});};return a;});

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fiveapples-0.0.7 lib/openui5-runtime-1.60.23/resources/sap/m/ResponsiveScale.js
fiveapples-0.0.6 lib/openui5-runtime-1.60.23/resources/sap/m/ResponsiveScale.js
fiveapples-0.0.5 lib/openui5-runtime-1.60.23/resources/sap/m/ResponsiveScale.js