Skip to content

Commit

Permalink
Merging 4.4.3 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dioslaska committed Dec 21, 2018
1 parent e47e7d5 commit ac5877f
Show file tree
Hide file tree
Showing 31 changed files with 425 additions and 236 deletions.
2 changes: 1 addition & 1 deletion examples/angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"@angular/platform-browser": "^5.2.11",
"@angular/platform-browser-dynamic": "^5.2.11",
"@angular/router": "^5.2.11",
"@mobiscroll/angular-lite": "^4.4.2",
"@mobiscroll/angular-lite": "^4.4.3",
"core-js": "^2.5.7",
"rxjs": "^5.5.11",
"zone.js": "^0.8.26"
Expand Down
2 changes: 1 addition & 1 deletion examples/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@mobiscroll/react-lite": "^4.4.2",
"@mobiscroll/react-lite": "^4.4.3",
"react": "^16.4.1",
"react-dom": "^16.4.1",
"react-scripts": "^1.1.4"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mobiscroll",
"version": "4.4.2",
"version": "4.4.3",
"description": "Cross platform UI controls for progressive web an hybrid apps",
"homepage": "https://mobiscroll.com/",
"license": "Apache-2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/angular/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mobiscroll/angular-lite",
"version": "4.4.2",
"version": "4.4.3",
"description": "Angular UI library for progressive web and hybrid apps",
"homepage": "https://mobiscroll.com/",
"license": "Apache-2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/angularjs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mobiscroll/angularjs-lite",
"version": "4.4.2",
"version": "4.4.3",
"description": "AngularJS UI library for progressive web and hybrid apps",
"homepage": "https://mobiscroll.com/",
"license": "Apache-2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/javascript/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mobiscroll/javascript-lite",
"version": "4.4.2",
"version": "4.4.3",
"description": "Framework agnostic UI library for progressive web and hybrid apps",
"homepage": "https://mobiscroll.com/",
"license": "Apache-2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/jquery/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mobiscroll/jquery-lite",
"version": "4.4.2",
"version": "4.4.3",
"description": "jQuery and jQuery Mobile UI library for progressive web and hybrid apps",
"homepage": "https://mobiscroll.com/",
"license": "Apache-2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mobiscroll/react-lite",
"version": "4.4.2",
"version": "4.4.3",
"description": "React UI library for progressive web and hybrid apps",
"homepage": "https://mobiscroll.com/",
"license": "Apache-2.0",
Expand Down
39 changes: 11 additions & 28 deletions src/js/classes/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,54 +7,37 @@ export class Input extends FormControl {
super(elm, settings);

addIconToggle(this, this._$parent, this._$elm);

this._$parent.addClass('mbsc-input');
this.checkLabel = this.checkLabel.bind(this);

// Attach events
// Prevent 300ms click latency
events.forEach(ev => {
elm.addEventListener(ev, this);
this._$elm.on(ev, this.checkLabel);
});

setTimeout(() => {
// if label is floating and input is autofill, add floating active class
// input has no value yet
if (this._isFloating && this._$elm.is("*:-webkit-autofill")) {
if (this._isFloating && this._$elm.is('*:-webkit-autofill')) {
this._$parent.addClass('mbsc-label-floating-active');
}
});
}

handleEvent(ev) {
super.handleEvent(ev);
switch (ev.type) {
case 'focus':
this.onFocus();
break;
case 'change':
case 'blur':
this.onChange();
break;
}
}

refresh() {
this.onChange();
}

onChange() {
checkLabel(ev) {
if (this._isFloating) {
if (!this._elm.value) {
this._$parent.removeClass('mbsc-label-floating-active');
} else {
if (this._elm.value || (ev && ev.type == 'focus')) {
this._$parent.addClass('mbsc-label-floating-active');
} else {
this._$parent.removeClass('mbsc-label-floating-active');
}
}
}

onFocus() {
if (this._isFloating) {
this._$parent.addClass('mbsc-label-floating-active');
}
refresh() {
this.checkLabel();
}

destroy() {
Expand All @@ -65,7 +48,7 @@ export class Input extends FormControl {
.remove();

events.forEach(ev => {
this._elm.removeEventListener(ev, this);
this._$elm.off(ev, this.checkLabel);
});
}
}
19 changes: 5 additions & 14 deletions src/js/classes/scroller.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@
import { mobiscroll } from '../core/core'; // mobiscroll needed for trial
/* eslint-enable no-unused-vars */
import { $, extend, classes } from '../core/core';
import { os, isBrowser } from '../util/platform';
import { cssPrefix, jsPrefix } from '../util/dom';
import { isNumeric, objectToArray } from '../util/misc';
import { isBrowser } from '../util/platform';
import { createStepper } from '../util/stepper';
import { Frame } from './frame';
import { ScrollViewBase } from './scrollview-base';

var presets = {},
css = isBrowser ? window.CSS : null,
has3d = css && css.supports && css.supports("(transform-style: preserve-3d)"),
force2D = !has3d || os == 'wp' || os == 'android';
has3d = css && css.supports && css.supports("(transform-style: preserve-3d)");

function sanitize(str) {
return (str + '').replace('"', '___');
Expand All @@ -31,7 +30,6 @@ export const Scroller = function (el, settings, inherit) {
showScrollArrows,
stepper,
tempWheelArray,
hasScrollbar,
itemHeight,
itemHeight3d,
isPointer,
Expand Down Expand Up @@ -506,7 +504,7 @@ export const Scroller = function (el, settings, inherit) {
that._wheelArray = [];
for (var i = 0; i < tempWheelArray.length; i++) {
// In case of multiple select wheel take the first selected value,
that._wheelArray[i] = wheels[i] && wheels[i].multiple ? Object.keys(that._tempSelected[i])[0] : tempWheelArray[i];
that._wheelArray[i] = wheels[i] && wheels[i].multiple ? Object.keys(that._tempSelected[i] || {})[0] : tempWheelArray[i];
}
that._value = that._hasValue ? that._tempValue : null;
that._selected = extend(true, {}, that._tempSelected);
Expand Down Expand Up @@ -644,7 +642,7 @@ export const Scroller = function (el, settings, inherit) {
(s.width ? ('width:' + (s.width[l] || s.width) + 'px;') :
(s.minWidth ? ('min-width:' + (s.minWidth[l] || s.minWidth) + 'px;') : '') +
(s.maxWidth ? ('max-width:' + (s.maxWidth[l] || s.maxWidth) + 'px;') : '')) + '">' +
(hasScrollbar ? '<div class="mbsc-sc-bar-c"><div class="mbsc-sc-bar"></div></div>' : '') + // Scrollbar
(isPointer ? '<div class="mbsc-sc-bar-c"><div class="mbsc-sc-bar"></div></div>' : '') + // Scrollbar
'<div class="mbsc-sc-whl-o" style="' + style + '"></div>' + highlight +
'<div aria-live="off" aria-label="' + lbl + '"' + (w.multiple ? ' aria-multiselectable="true"' : '') + ' role="listbox" data-index="' + l + '" class="mbsc-sc-whl"' + ' style="' +
'height:' + (s.rows * itemHeight * (scroll3d ? 1.1 : 1)) + 'px;">' +
Expand Down Expand Up @@ -832,17 +830,10 @@ export const Scroller = function (el, settings, inherit) {
that._wheelArray = null;
}

if (isPointer) {
s.scroll3d = false;
hasScrollbar = true;
} else {
hasScrollbar = false;
}

wheels = [];
wheelsMap = {};
showScrollArrows = s.showScrollArrows;
scroll3d = s.scroll3d && !force2D && !showScrollArrows;
scroll3d = s.scroll3d && has3d && !showScrollArrows && !isPointer && (s.theme == 'ios' || s.baseTheme == 'ios');
itemHeight = s.height;
itemHeight3d = scroll3d ? Math.round((itemHeight - (itemHeight * s.rows / 2 + 3) * 0.03) / 2) * 2 : itemHeight;
batchSize3d = Math.round(s.rows * 1.8);
Expand Down
6 changes: 3 additions & 3 deletions src/js/classes/scrollview-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export const ScrollViewBase = function (el, settings, inherit) {
} else if (Math.abs(diffY) > 7) {
nativeScroll = true;
that.scrolled = true;
$elm.trigger('touchend');
onEnd();
}
}
}
Expand Down Expand Up @@ -199,7 +199,7 @@ export const ScrollViewBase = function (el, settings, inherit) {
time = new Date() - startTime;

// Better performance if there are tap events on document
if (s.stopProp) {
if (s.stopProp && ev) {
ev.stopPropagation();
}

Expand Down Expand Up @@ -233,7 +233,7 @@ export const ScrollViewBase = function (el, settings, inherit) {
}

// Detach document events
if (ev.type == 'mouseup') {
if (ev && ev.type == 'mouseup') {
$(document).off('mousemove', onMove).off('mouseup', onEnd);
}

Expand Down
4 changes: 2 additions & 2 deletions src/js/core/core.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Mobiscroll v4.4.2
* Mobiscroll v4.4.3
* http://mobiscroll.com
*
* Copyright 2010-2018, Acid Media
Expand Down Expand Up @@ -76,7 +76,7 @@ extend(util, {

ms = extend(mobiscroll, {
$: $,
version: '4.4.2',
version: '4.4.3',
autoTheme: 'mobiscroll',
themes: {
form: {},
Expand Down
Loading

0 comments on commit ac5877f

Please sign in to comment.