Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
dioslaska committed Jan 8, 2015
2 parents 23bd8f4 + 8f081f0 commit 06c4f43
Show file tree
Hide file tree
Showing 12 changed files with 49 additions and 74 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mobiscroll",
"version": "2.14.3",
"version": "2.14.4",
"main": [
"js/mobiscroll.core.js",
"js/mobiscroll.widget.js",
Expand Down
1 change: 1 addition & 0 deletions css/mobiscroll.widget.android-holo.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
}
.mbsc-android-holo .dwv {
color: #31b6e7;
padding: 0 .5em;
min-height: 2em;
line-height: 2em;
border-bottom: 2px solid #31b6e7;
Expand Down
6 changes: 6 additions & 0 deletions css/mobiscroll.widget.css
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@
border: 0;
overflow: hidden;
}
/* Header */
.dwv {
overflow: hidden;
text-overflow: ellipsis;
}
/* Buttons */
.dwb {
overflow: hidden;
Expand Down Expand Up @@ -165,6 +170,7 @@
font-size: 16px;
}
.mbsc-mobiscroll .dwv {
padding: 0 .6666em;
padding-top: .6666em;
color: #4eccc4;
font-size: .75em;
Expand Down
1 change: 1 addition & 0 deletions css/mobiscroll.widget.ios.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
padding-top: 40px;
}
.mbsc-ios .dwv {
padding: 0 5px;
color: #9d9d9d;
line-height: 30px;
min-height: 30px;
Expand Down
2 changes: 1 addition & 1 deletion css/mobiscroll.widget.jqm.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
position: static;
width: auto;
border: 0;
padding: 5px 0;
padding: 5px;
font-size: 14px;
min-height: 18px;
}
Expand Down
58 changes: 11 additions & 47 deletions js/mobiscroll.appframework.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,48 +168,6 @@ if (!window.jQuery) {
}
});

$.fn.position = function() {
if (!this[0]) {
return null;
}

var elem = this[0],

// Get *real* offsetParent
offsetParent = this.offsetParent(),
// Get correct offsets
offset = this.offset(),
parentOffset = rroot.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset();

// Subtract element margins
// note: when an element has margin: auto the offsetLeft and marginLeft
// are the same in Safari causing offset.left to incorrectly be 0
offset.top -= parseFloat($(elem).css("margin-top")) || 0;
offset.left -= parseFloat($(elem).css("margin-left")) || 0;

// Add offsetParent borders
parentOffset.top += parseFloat($(offsetParent[0]).css("border-top-width")) || 0;
parentOffset.left += parseFloat($(offsetParent[0]).css("border-left-width")) || 0;

// Subtract the two offsets
return {
top: offset.top - parentOffset.top,
left: offset.left - parentOffset.left
};
};

$.fn.offsetParent = function() {
var ret = $();
this.each(function(){
var offsetParent = this.offsetParent || document.body;
while ( offsetParent && (!rroot.test(offsetParent.nodeName) && $(offsetParent).css("position") === "static") ) {
offsetParent = offsetParent.offsetParent;
}
ret.push(offsetParent);
});
return ret;
};

$.fn.focus = function (handler) {
if (handler === undefined) {
return $(this).trigger('focus');
Expand Down Expand Up @@ -240,18 +198,24 @@ if (!window.jQuery) {
return this;
};

$.fn.detach = $.fn.remove;

$.fn.pluck = function (property) {
return this.map(function (i, e) { return e[property]; });
var ret = [];
this.each(function () {
if (this[property] !== undefined && this[property] !== null) {
ret.push(this[property]);
}
});
return $(ret);
};

$.fn.prev = function (selector) {
var p = this.pluck('previousElementSibling');
return p[0][0] ? $(p[0]).filter(selector || '*') : $([]);
return this.pluck('previousElementSibling').filter(selector || '*');
};

$.fn.next = function (selector) {
var n = this.pluck('nextElementSibling');
return n[0][0] ? $(n[0]).filter(selector || '*') : $([]);
return this.pluck('nextElementSibling').filter(selector || '*');
};

$.fn.prevUntil = function (selector) {
Expand Down
4 changes: 2 additions & 2 deletions js/mobiscroll.core.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Mobiscroll v2.14.3
* Mobiscroll v2.14.4
* http://mobiscroll.com
*
* Copyright 2010-2014, Acid Media
Expand Down Expand Up @@ -80,7 +80,7 @@
};

$.mobiscroll = $.mobiscroll || {
version: '2.14.3',
version: '2.14.4',
util: {
prefix: prefix,
jsPrefix: pr,
Expand Down
41 changes: 22 additions & 19 deletions js/mobiscroll.select.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
var change,
group,
groupWheelIdx,
headerText,
i,
input,
optionArray,
Expand Down Expand Up @@ -194,7 +193,11 @@
}

function getOption(v) {
option = multiple ? (v ? v[0] : defaultValue) : (v === undefined || v === null || v === '' ? defaultValue : v);
if (multiple && $.isArray(v)) {
v = v[0];
}

option = v === undefined || v === null || v === '' ? defaultValue : v;

if (groupWheel) {
group = options[option].group;
Expand All @@ -206,7 +209,7 @@
return val ? (s.group && group ? val : val[optionWheelIdx]) : null;
}

function onFill(v) {
function onFill() {
var txt,
val,
sel = [],
Expand All @@ -216,18 +219,16 @@
val = [];

for (i in selectedValues) {
sel.push(options[i].text);
sel.push(options[i] ? options[i].text : '');
val.push(i);
}

txt = sel.join(', ');
} else {
val = v;
txt = options[v] ? options[v].text : '';
val = option;
txt = options[option] ? options[option].text : '';
}

inst._tempValue = val;

input.val(txt);
elm.val(val);
}
Expand Down Expand Up @@ -287,7 +288,7 @@

elm.addClass('dw-hsel').attr('tabindex', -1).closest('.ui-field-contain').trigger('create');

onFill(option);
onFill();

// Extended methods
// ---
Expand Down Expand Up @@ -325,11 +326,21 @@
headerText: false,
anchor: input,
formatResult: function (d) {
return d[optionWheelIdx];
var i,
sel = [];

if (multiple) {
for (i in selectedValues) {
sel.push(options[i] ? options[i].text : '');
}
return sel.join(', ');
}

option = d[optionWheelIdx];
return options[option] ? options[option].text : '';
},
parseValue: function (val) {
getOption(val === undefined ? elm.val() : val);

return groupWheel ? [group, option] : [option];
},
onValueTap: onTap,
Expand All @@ -345,14 +356,6 @@
};
}

// In header text replace {value} with the option text instead of the value
if (isString(s.headerText) && /{value}/.test(s.headerText)) {
headerText = s.headerText;
s.headerText = function (v) {
return headerText.replace(/\{value\}/i, options[v].text);
};
}

getOption(elm.val());

if (groupWheel) {
Expand Down
2 changes: 1 addition & 1 deletion mobiscroll.datetime.jquery.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"scroller",
"clickpick"
],
"version": "2.14.3",
"version": "2.14.4",
"author": {
"name": "Acid Media",
"url": "http://theacidmedia.net"
Expand Down
2 changes: 1 addition & 1 deletion mobiscroll.imageandtext.jquery.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"scroller",
"clickpick"
],
"version": "2.14.3",
"version": "2.14.4",
"author": {
"name": "Acid Media",
"url": "http://theacidmedia.net"
Expand Down
2 changes: 1 addition & 1 deletion mobiscroll.select.jquery.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"scroller",
"clickpick"
],
"version": "2.14.3",
"version": "2.14.4",
"author": {
"name": "Acid Media",
"url": "http://theacidmedia.net"
Expand Down
2 changes: 1 addition & 1 deletion mobiscroll.treelist.jquery.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"scroller",
"clickpick"
],
"version": "2.14.3",
"version": "2.14.4",
"author": {
"name": "Acid Media",
"url": "http://theacidmedia.net"
Expand Down

0 comments on commit 06c4f43

Please sign in to comment.