MCPcopy Index your code
hub / github.com/csev/py4e / get_position

Function get_position

tools/pythonauto/static/splitter/jquery.splitter-0.14.0.js:65–86  ·  view source on GitHub ↗
(position)

Source from the content-addressed store, hash-verified

63 var position;
64
65 function get_position(position) {
66 if (typeof position === 'number') {
67 return position;
68 } else if (typeof position === 'string') {
69 var match = position.match(/^([0-9]+)(px|%)$/);
70 if (match) {
71 if (match[2] == 'px') {
72 return +match[1];
73 } else {
74 if (settings.orientation == 'vertical') {
75 return (width * +match[1]) / 100;
76 } else if (settings.orientation == 'horizontal') {
77 return (height * +match[1]) / 100;
78 }
79 }
80 } else {
81 //throw position + ' is invalid value';
82 }
83 } else {
84 //throw 'position have invalid type';
85 }
86 }
87
88 var self = $.extend(this, {
89 refresh: function() {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected