From d493a1390150af0a822d28d66b98e7c9e42cd0d7 Mon Sep 17 00:00:00 2001 From: szily20 Date: Thu, 19 Feb 2015 15:59:31 +0200 Subject: [PATCH 01/10] Mouse pointer to cursor over wheel items --- css/mobiscroll.scroller.css | 1 + 1 file changed, 1 insertion(+) diff --git a/css/mobiscroll.scroller.css b/css/mobiscroll.scroller.css index 022ab773..3aa3077a 100644 --- a/css/mobiscroll.scroller.css +++ b/css/mobiscroll.scroller.css @@ -77,6 +77,7 @@ vertical-align: bottom; opacity: .3; filter: Alpha(Opacity=30); + cursor: pointer; } /* Valid entry */ .dw-li.dw-v, From 06102501ad8c3bf4f8961a0d76745d5dd1cca169 Mon Sep 17 00:00:00 2001 From: Istvan Halmen Date: Fri, 20 Feb 2015 17:56:13 +0200 Subject: [PATCH 02/10] Move setting --- js/mobiscroll.datetimebase.js | 1 + js/mobiscroll.util.datetime.js | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/js/mobiscroll.datetimebase.js b/js/mobiscroll.datetimebase.js index 67d89f25..42990cf2 100644 --- a/js/mobiscroll.datetimebase.js +++ b/js/mobiscroll.datetimebase.js @@ -13,6 +13,7 @@ timeWheels: 'hhiiA', timeFormat: 'hh:ii A', dayText: 'Day', + monthText: 'Month', yearText: 'Year', hourText: 'Hours', minuteText: 'Minutes', diff --git a/js/mobiscroll.util.datetime.js b/js/mobiscroll.util.datetime.js index d2aa322e..f1bfe7a1 100644 --- a/js/mobiscroll.util.datetime.js +++ b/js/mobiscroll.util.datetime.js @@ -9,7 +9,6 @@ dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], dayNamesMin: ['S', 'M', 'T', 'W', 'T', 'F', 'S'], - monthText: 'Month', amText: 'am', pmText: 'pm', getYear: function (d) { return d.getFullYear(); }, From 48ccc4f0f5a3515c50d4c38b2f4dc926edb66ff6 Mon Sep 17 00:00:00 2001 From: Istvan Halmen Date: Wed, 25 Feb 2015 12:02:00 +0200 Subject: [PATCH 03/10] Time setVal fix (#291) --- js/mobiscroll.datetimebase.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/js/mobiscroll.datetimebase.js b/js/mobiscroll.datetimebase.js index 42990cf2..235e798c 100644 --- a/js/mobiscroll.datetimebase.js +++ b/js/mobiscroll.datetimebase.js @@ -299,6 +299,10 @@ up = 0, down = 0; + // Normalize min and max dates for comparing later (set default values where there are no values from wheels) + mind = getDate(getArray(mind)); + maxd = getDate(getArray(maxd)); + if (isValid(d)) { return d; } @@ -666,10 +670,6 @@ invalid = convertRanges(invalid); valid = convertRanges(valid); - // Normalize min and max dates for comparing later (set default values where there are no values from wheels) - mind = getDate(getArray(mind)); - maxd = getDate(getArray(maxd)); - mins = { y: mind.getFullYear(), m: 0, d: 1, h: minH, i: minM, s: minS, a: 0 }; maxs = { y: maxd.getFullYear(), m: 11, d: 31, h: maxH, i: maxM, s: maxS, a: 1 }; From b56750e5c622f27a43aa2d8a0d2af29c3b38ee7a Mon Sep 17 00:00:00 2001 From: szily20 Date: Wed, 4 Mar 2015 12:20:33 +0200 Subject: [PATCH 04/10] Listview backText and undoText translations added to the language files (#292) --- js/i18n/mobiscroll.i18n.cs.js | 5 ++++- js/i18n/mobiscroll.i18n.de.js | 5 ++++- js/i18n/mobiscroll.i18n.es.js | 5 ++++- js/i18n/mobiscroll.i18n.fa.js | 5 ++++- js/i18n/mobiscroll.i18n.fr.js | 5 ++++- js/i18n/mobiscroll.i18n.hu.js | 5 ++++- js/i18n/mobiscroll.i18n.it.js | 5 ++++- js/i18n/mobiscroll.i18n.ja.js | 5 ++++- js/i18n/mobiscroll.i18n.nl.js | 5 ++++- js/i18n/mobiscroll.i18n.no.js | 5 ++++- js/i18n/mobiscroll.i18n.pl.js | 5 ++++- js/i18n/mobiscroll.i18n.pt-BR.js | 5 ++++- js/i18n/mobiscroll.i18n.pt-PT.js | 5 ++++- js/i18n/mobiscroll.i18n.ro.js | 5 ++++- js/i18n/mobiscroll.i18n.ru-UA.js | 5 ++++- js/i18n/mobiscroll.i18n.ru.js | 5 ++++- js/i18n/mobiscroll.i18n.sk.js | 5 ++++- js/i18n/mobiscroll.i18n.sv.js | 5 ++++- js/i18n/mobiscroll.i18n.tr.js | 5 ++++- js/i18n/mobiscroll.i18n.zh.js | 5 ++++- 20 files changed, 80 insertions(+), 20 deletions(-) diff --git a/js/i18n/mobiscroll.i18n.cs.js b/js/i18n/mobiscroll.i18n.cs.js index 9b5e45b4..3736fd82 100644 --- a/js/i18n/mobiscroll.i18n.cs.js +++ b/js/i18n/mobiscroll.i18n.cs.js @@ -45,6 +45,9 @@ stopText: 'Stop', resetText: 'Resetovat', lapText: 'Etapa', - hideText: 'Schovat' + hideText: 'Schovat', + // Listview + backText: 'Zpět', + undoText: 'Rozlepit' }); })(jQuery); diff --git a/js/i18n/mobiscroll.i18n.de.js b/js/i18n/mobiscroll.i18n.de.js index 1ff35477..d620364d 100644 --- a/js/i18n/mobiscroll.i18n.de.js +++ b/js/i18n/mobiscroll.i18n.de.js @@ -46,6 +46,9 @@ stopText: 'Stoppen', resetText: 'Zurücksetzen', lapText: 'Lap', - hideText: 'Ausblenden' + hideText: 'Ausblenden', + // Listview + backText: 'Zurück', + undoText: 'Rückgängig' }); })(jQuery); diff --git a/js/i18n/mobiscroll.i18n.es.js b/js/i18n/mobiscroll.i18n.es.js index 2e66f1f7..15a9b269 100644 --- a/js/i18n/mobiscroll.i18n.es.js +++ b/js/i18n/mobiscroll.i18n.es.js @@ -44,6 +44,9 @@ stopText: 'Deténgase', resetText: 'Reinicializar', lapText: 'Lap', - hideText: 'Esconder' + hideText: 'Esconder', + // Listview + backText: 'Espalda', + undoText: 'Deshacer' }); })(jQuery); diff --git a/js/i18n/mobiscroll.i18n.fa.js b/js/i18n/mobiscroll.i18n.fa.js index 01861816..468c9ff3 100644 --- a/js/i18n/mobiscroll.i18n.fa.js +++ b/js/i18n/mobiscroll.i18n.fa.js @@ -200,6 +200,9 @@ stopText: 'پايان', resetText: 'تنظیم مجدد', lapText: 'Lap', - hideText: 'پنهان کردن' + hideText: 'پنهان کردن', + // Listview + backText: 'پشت', + undoText: 'واچیدن' }); })(jQuery); \ No newline at end of file diff --git a/js/i18n/mobiscroll.i18n.fr.js b/js/i18n/mobiscroll.i18n.fr.js index b76a6d31..2b0b67e8 100644 --- a/js/i18n/mobiscroll.i18n.fr.js +++ b/js/i18n/mobiscroll.i18n.fr.js @@ -45,6 +45,9 @@ stopText: 'Arrêter', resetText: 'Réinitialiser', lapText: 'Lap', - hideText: 'Cachez' + hideText: 'Cachez', + // Listview + backText: 'Arrière', + undoText: 'Défaire' }); })(jQuery); diff --git a/js/i18n/mobiscroll.i18n.hu.js b/js/i18n/mobiscroll.i18n.hu.js index bd37fc41..5b307cf9 100644 --- a/js/i18n/mobiscroll.i18n.hu.js +++ b/js/i18n/mobiscroll.i18n.hu.js @@ -53,6 +53,9 @@ stopText: 'Megállít', resetText: 'Visszaállít', lapText: 'Lap', - hideText: 'Elrejt' + hideText: 'Elrejt', + // Listview + backText: 'Vissza', + undoText: 'Visszavon' }); })(jQuery); diff --git a/js/i18n/mobiscroll.i18n.it.js b/js/i18n/mobiscroll.i18n.it.js index 2b7e1bc6..e5fcb87f 100644 --- a/js/i18n/mobiscroll.i18n.it.js +++ b/js/i18n/mobiscroll.i18n.it.js @@ -45,6 +45,9 @@ stopText: 'Arresto', resetText: 'Ripristina', lapText: 'Lap', - hideText: 'Nascondi' + hideText: 'Nascondi', + // Listview + backText: 'Indietro', + undoText: 'Disfare' }); })(jQuery); diff --git a/js/i18n/mobiscroll.i18n.ja.js b/js/i18n/mobiscroll.i18n.ja.js index 9c58fc52..81d63798 100644 --- a/js/i18n/mobiscroll.i18n.ja.js +++ b/js/i18n/mobiscroll.i18n.ja.js @@ -47,6 +47,9 @@ stopText: '停止', resetText: 'リセット', lapText: 'ラップ', - hideText: '隠す' + hideText: '隠す', + // Listview + backText: 'バック', + undoText: 'アンドゥ' }); })(jQuery); diff --git a/js/i18n/mobiscroll.i18n.nl.js b/js/i18n/mobiscroll.i18n.nl.js index 984b7338..dc81ce22 100644 --- a/js/i18n/mobiscroll.i18n.nl.js +++ b/js/i18n/mobiscroll.i18n.nl.js @@ -45,6 +45,9 @@ stopText: 'Stop', resetText: 'Reset', lapText: 'Ronde', - hideText: 'Verbergen' + hideText: 'Verbergen', + // Listview + backText: 'Terug', + undoText: 'Ongedaan' }); })(jQuery); diff --git a/js/i18n/mobiscroll.i18n.no.js b/js/i18n/mobiscroll.i18n.no.js index 57647813..2139e5d9 100644 --- a/js/i18n/mobiscroll.i18n.no.js +++ b/js/i18n/mobiscroll.i18n.no.js @@ -46,6 +46,9 @@ stopText: 'Stopp', resetText: 'Tilbakestille', lapText: 'Runde', - hideText: 'Skjul' + hideText: 'Skjul', + // Listview + backText: 'Tilbake', + undoText: 'Angre' }); })(jQuery); diff --git a/js/i18n/mobiscroll.i18n.pl.js b/js/i18n/mobiscroll.i18n.pl.js index 01832a52..abe872c2 100644 --- a/js/i18n/mobiscroll.i18n.pl.js +++ b/js/i18n/mobiscroll.i18n.pl.js @@ -45,6 +45,9 @@ stopText: 'Zatrzymać', resetText: 'Zresetować', lapText: 'Zakładka', - hideText: 'Ukryć' + hideText: 'Ukryć', + // Listview + backText: 'Z powrotem', + undoText: 'Odwiązać' }); })(jQuery); diff --git a/js/i18n/mobiscroll.i18n.pt-BR.js b/js/i18n/mobiscroll.i18n.pt-BR.js index 64b79a72..f9758b4b 100644 --- a/js/i18n/mobiscroll.i18n.pt-BR.js +++ b/js/i18n/mobiscroll.i18n.pt-BR.js @@ -47,6 +47,9 @@ stopText: 'Pare', resetText: 'Reinicializar', lapText: 'Lap', - hideText: 'Esconder' + hideText: 'Esconder', + // Listview + backText: 'De volta', + undoText: 'Desfazer' }); })(jQuery); diff --git a/js/i18n/mobiscroll.i18n.pt-PT.js b/js/i18n/mobiscroll.i18n.pt-PT.js index 3b66707c..45ace68d 100644 --- a/js/i18n/mobiscroll.i18n.pt-PT.js +++ b/js/i18n/mobiscroll.i18n.pt-PT.js @@ -48,6 +48,9 @@ stopText: 'Parar', resetText: 'Reinicializar', lapText: 'Lap', - hideText: 'Esconder' + hideText: 'Esconder', + // Listview + backText: 'De volta', + undoText: 'Desfazer' }); })(jQuery); diff --git a/js/i18n/mobiscroll.i18n.ro.js b/js/i18n/mobiscroll.i18n.ro.js index c5b73fbc..39e32d0d 100644 --- a/js/i18n/mobiscroll.i18n.ro.js +++ b/js/i18n/mobiscroll.i18n.ro.js @@ -46,6 +46,9 @@ stopText: 'Stop', resetText: 'Resetare', lapText: 'Tură', - hideText: 'Ascundere' + hideText: 'Ascundere', + // Listview + backText: 'Înapoi', + undoText: 'Desface' }); })(jQuery); diff --git a/js/i18n/mobiscroll.i18n.ru-UA.js b/js/i18n/mobiscroll.i18n.ru-UA.js index 692562fe..9d17a67a 100644 --- a/js/i18n/mobiscroll.i18n.ru-UA.js +++ b/js/i18n/mobiscroll.i18n.ru-UA.js @@ -46,6 +46,9 @@ stopText: 'Стоп', resetText: ' Сброс ', lapText: ' Этап ', - hideText: ' Скрыть ' + hideText: ' Скрыть ', + // Listview + backText: 'назад', + undoText: 'аннулировать' }); })(jQuery); diff --git a/js/i18n/mobiscroll.i18n.ru.js b/js/i18n/mobiscroll.i18n.ru.js index 564a7b81..c0546520 100644 --- a/js/i18n/mobiscroll.i18n.ru.js +++ b/js/i18n/mobiscroll.i18n.ru.js @@ -50,6 +50,9 @@ stopText: 'Стоп', resetText: 'Сбросить', lapText: 'Круг', - hideText: 'Скрыть' + hideText: 'Скрыть', + // Listview + backText: 'назад', + undoText: 'аннулировать' }); })(jQuery); diff --git a/js/i18n/mobiscroll.i18n.sk.js b/js/i18n/mobiscroll.i18n.sk.js index 5860f2c1..68ecdb48 100644 --- a/js/i18n/mobiscroll.i18n.sk.js +++ b/js/i18n/mobiscroll.i18n.sk.js @@ -45,6 +45,9 @@ stopText: 'Stop', resetText: 'Resetovať', lapText: 'Etapa', - hideText: 'Schovať' + hideText: 'Schovať', + // Listview + backText: 'Späť', + undoText: 'Zrušiť' }); })(jQuery); diff --git a/js/i18n/mobiscroll.i18n.sv.js b/js/i18n/mobiscroll.i18n.sv.js index b32c18cf..aff3d5c2 100644 --- a/js/i18n/mobiscroll.i18n.sv.js +++ b/js/i18n/mobiscroll.i18n.sv.js @@ -45,6 +45,9 @@ stopText: 'Stopp', resetText: 'Återställ', lapText: 'Varv', - hideText: 'Dölj' + hideText: 'Dölj', + // Listview + backText: 'Tillbaka', + undoText: 'Ångra' }); })(jQuery); \ No newline at end of file diff --git a/js/i18n/mobiscroll.i18n.tr.js b/js/i18n/mobiscroll.i18n.tr.js index 9b3ebfb0..d39eb3a2 100644 --- a/js/i18n/mobiscroll.i18n.tr.js +++ b/js/i18n/mobiscroll.i18n.tr.js @@ -46,6 +46,9 @@ stopText: 'Durdur', resetText: 'Sıfırla', lapText: 'Tur', - hideText: 'Gizle' + hideText: 'Gizle', + // Listview + backText: 'Geri', + undoText: 'Sökmek' }); })(jQuery); diff --git a/js/i18n/mobiscroll.i18n.zh.js b/js/i18n/mobiscroll.i18n.zh.js index 442bb3af..bec0dea9 100644 --- a/js/i18n/mobiscroll.i18n.zh.js +++ b/js/i18n/mobiscroll.i18n.zh.js @@ -44,6 +44,9 @@ stopText: '停止', resetText: '重置', lapText: '圈', - hideText: '隐藏' + hideText: '隐藏', + // Listview + backText: '背部', + undoText: '复原' }); })(jQuery); \ No newline at end of file From a467382987d47bf9d30d97818ea5d30555d6e3d8 Mon Sep 17 00:00:00 2001 From: Istvan Halmen Date: Wed, 25 Mar 2015 14:16:20 +0200 Subject: [PATCH 05/10] Fix for null value (if not initialized on a form field) - also affects dynamic defaultValue change (#296) --- js/mobiscroll.scroller.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/js/mobiscroll.scroller.js b/js/mobiscroll.scroller.js index 6f804985..b20f1cfc 100644 --- a/js/mobiscroll.scroller.js +++ b/js/mobiscroll.scroller.js @@ -620,8 +620,12 @@ that._readValue = function () { var v = $elm.val() || ''; - that._hasValue = v !== ''; - that._tempWheelArray = that._wheelArray ? that._wheelArray.slice(0) : s.parseValue(v, that) || []; + + if (v !== '') { + that._hasValue = true; + } + + that._tempWheelArray = that._hasValue && that._wheelArray ? that._wheelArray.slice(0) : s.parseValue(v, that) || []; setValue(); }; From 78f71bf128d3e392338444bd96dbaaa7b5c89587 Mon Sep 17 00:00:00 2001 From: Istvan Halmen Date: Wed, 25 Mar 2015 17:23:40 +0200 Subject: [PATCH 06/10] WP theme clickpick mode fix --- css/mobiscroll.wp-light.css | 14 +++++++++++ js/mobiscroll.frame.wp.js | 46 +++++++++++++++++++------------------ js/mobiscroll.wp-light.js | 44 ++++++++++++++++++----------------- 3 files changed, 61 insertions(+), 43 deletions(-) diff --git a/css/mobiscroll.wp-light.css b/css/mobiscroll.wp-light.css index 7374e349..c5f0d2c0 100644 --- a/css/mobiscroll.wp-light.css +++ b/css/mobiscroll.wp-light.css @@ -19,6 +19,20 @@ background: rgb(181,181,181); border-color: rgb(181,181,181); } +/* Clickpick-mode */ +.mbsc-wp-light .dwwb { + background: rgb(222,222,222); +} +.mbsc-wp-light .dwwb:before { + color: rgb(0,0,0); + border-color: rgb(0,0,0); +} +.mbsc-wp-light .dwwl .dwb-a { + background: rgb(222,222,222); +} +.mbsc-wp-light .dwwl .dwb-a:before { + color: rgb(222,222,222); +} /* Bubble positioning */ .mbsc-wp-light .dw-bubble-bottom .dw-arr { border-color: transparent transparent rgb(222,222,222) transparent; diff --git a/js/mobiscroll.frame.wp.js b/js/mobiscroll.frame.wp.js index 7e53330f..fcb436b6 100644 --- a/js/mobiscroll.frame.wp.js +++ b/js/mobiscroll.frame.wp.js @@ -19,32 +19,34 @@ btnCalNextClass: 'mbsc-ic mbsc-ic-arrow-right2', btnPlusClass: 'mbsc-ic mbsc-ic-plus', btnMinusClass: 'mbsc-ic mbsc-ic-minus', - onMarkupInserted: function (elm) { + onMarkupInserted: function (elm, inst) { var click, touch, active; - $('.dwwl', elm).on('touchstart mousedown wheel mousewheel', function (e) { - if (e.type === 'mousedown' && touch) { - return; - } - touch = e.type === 'touchstart'; - click = true; - active = $(this).hasClass('wpa'); - $('.dwwl', elm).removeClass('wpa'); - $('.dw-sel', this).removeClass('dw-sel'); - $(this).addClass('wpa'); - }).on('touchmove mousemove', function () { - click = false; - }).on('touchend mouseup', function (e) { - if (click && active && $(e.target).closest('.dw-li').hasClass('dw-sel')) { - $(this).removeClass('wpa'); - } - if (e.type === 'mouseup') { - touch = false; - } - click = false; - }); + if (inst.settings.mode != 'clickpick') { + $('.dwwl', elm).on('touchstart mousedown wheel mousewheel', function (e) { + if (e.type === 'mousedown' && touch) { + return; + } + touch = e.type === 'touchstart'; + click = true; + active = $(this).hasClass('wpa'); + $('.dwwl', elm).removeClass('wpa'); + $('.dw-sel', this).removeClass('dw-sel'); + $(this).addClass('wpa'); + }).on('touchmove mousemove', function () { + click = false; + }).on('touchend mouseup', function (e) { + if (click && active && $(e.target).closest('.dw-li').hasClass('dw-sel')) { + $(this).removeClass('wpa'); + } + if (e.type === 'mouseup') { + touch = false; + } + click = false; + }); + } }, onThemeLoad: function (lang, s) { if (lang && lang.dateOrder && !s.dateOrder) { diff --git a/js/mobiscroll.wp-light.js b/js/mobiscroll.wp-light.js index 53f68223..45e3d154 100644 --- a/js/mobiscroll.wp-light.js +++ b/js/mobiscroll.wp-light.js @@ -20,31 +20,33 @@ btnCalNextClass: 'mbsc-ic mbsc-ic-arrow-right2', btnPlusClass: 'mbsc-ic mbsc-ic-plus', btnMinusClass: 'mbsc-ic mbsc-ic-minus', - onMarkupInserted: function (elm) { + onMarkupInserted: function (elm, inst) { var click, touch, active; - $('.dwwl', elm).on('touchstart mousedown wheel mousewheel', function (e) { - if (e.type === 'mousedown' && touch) { - return; - } - touch = e.type === 'touchstart'; - click = true; - active = $(this).hasClass('wpa'); - $('.dwwl', elm).removeClass('wpa'); - $(this).addClass('wpa'); - }).on('touchmove mousemove', function () { - click = false; - }).on('touchend mouseup', function (e) { - if (click && active && $(e.target).closest('.dw-li').hasClass('dw-sel')) { - $(this).removeClass('wpa'); - } - if (e.type === 'mouseup') { - touch = false; - } - click = false; - }); + if (inst.settings.mode != 'clickpick') { + $('.dwwl', elm).on('touchstart mousedown wheel mousewheel', function (e) { + if (e.type === 'mousedown' && touch) { + return; + } + touch = e.type === 'touchstart'; + click = true; + active = $(this).hasClass('wpa'); + $('.dwwl', elm).removeClass('wpa'); + $(this).addClass('wpa'); + }).on('touchmove mousemove', function () { + click = false; + }).on('touchend mouseup', function (e) { + if (click && active && $(e.target).closest('.dw-li').hasClass('dw-sel')) { + $(this).removeClass('wpa'); + } + if (e.type === 'mouseup') { + touch = false; + } + click = false; + }); + } }, onThemeLoad: function (lang, s) { if (lang && lang.dateOrder && !s.dateOrder) { From 4ec02958b1c87dd3ccf62fc452206d2c9034456e Mon Sep 17 00:00:00 2001 From: Istvan Halmen Date: Thu, 26 Mar 2015 16:30:58 +0200 Subject: [PATCH 07/10] If modal, keep the focus inside the widget (#290). --- css/mobiscroll.frame.css | 3 +++ js/mobiscroll.frame.js | 38 ++++++++++++++++++++++++++++++++++++-- 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/css/mobiscroll.frame.css b/css/mobiscroll.frame.css index 871f423e..b1ffb468 100644 --- a/css/mobiscroll.frame.css +++ b/css/mobiscroll.frame.css @@ -21,6 +21,9 @@ /*outline-color: transparent;*/ outline: none; } +.dw :focus { + outline-offset: -2px; +} .dw-rtl { direction: rtl; } diff --git a/js/mobiscroll.frame.js b/js/mobiscroll.frame.js index 4e000a8c..02493968 100644 --- a/js/mobiscroll.frame.js +++ b/js/mobiscroll.frame.js @@ -134,6 +134,12 @@ }, 200); } + function onFocus(ev) { + if (!$popup[0].contains(ev.target)) { + $popup.focus(); + } + } + function show(beforeShow, $elm) { if (!ms.tapped) { @@ -510,7 +516,9 @@ // Set position that.position(); - $wnd.on(posEvents, onPosition); + $wnd + .on(posEvents, onPosition) + .on('focusin', onFocus); // Events $markup @@ -522,6 +530,30 @@ ev.stopPropagation(); $(this).click(); } + }) + .on('keydown', function (ev) { // Trap focus inside modal + if (ev.keyCode == 32) { // Space + ev.preventDefault(); + } else if (ev.keyCode == 9) { // Tab + + var $focusable = $markup.find('[tabindex="0"]').filter(function () { + return this.offsetWidth > 0 || this.offsetHeight > 0; + }), + index = $focusable.index($(':focus', $markup)), + i = $focusable.length - 1, + target = 0; + + if (ev.shiftKey) { + i = 0; + target = -1; + } + + if (index === i) { + $focusable.eq(target).focus(); + ev.preventDefault(); + } + + } }); $('input', $markup).on('selectstart mousedown', function (ev) { @@ -587,7 +619,9 @@ } // Stop positioning on window resize - $wnd.off(posEvents, onPosition); + $wnd + .off(posEvents, onPosition) + .off('focusin', onFocus); } if (isModal) { From 52eab8e5b2d2648541a99e9f8f06bcec453cf7d2 Mon Sep 17 00:00:00 2001 From: Istvan Halmen Date: Mon, 30 Mar 2015 10:47:08 +0300 Subject: [PATCH 08/10] Change copyright year --- js/mobiscroll.core.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/mobiscroll.core.js b/js/mobiscroll.core.js index 1f9c0cae..7cd28796 100644 --- a/js/mobiscroll.core.js +++ b/js/mobiscroll.core.js @@ -2,7 +2,7 @@ * Mobiscroll v2.15.0 * http://mobiscroll.com * - * Copyright 2010-2014, Acid Media + * Copyright 2010-2015, Acid Media * Licensed under the MIT license. * */ From be1936645425566a6fddb59de35620419926eeb5 Mon Sep 17 00:00:00 2001 From: Istvan Halmen Date: Thu, 2 Apr 2015 11:27:38 +0300 Subject: [PATCH 09/10] Pass instance to formatValue --- js/mobiscroll.scroller.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/mobiscroll.scroller.js b/js/mobiscroll.scroller.js index b20f1cfc..ad3dd0b1 100644 --- a/js/mobiscroll.scroller.js +++ b/js/mobiscroll.scroller.js @@ -390,7 +390,7 @@ trigger('onValidated', []); // Reformat value if validation changed something - that._tempValue = s.formatValue(that._tempWheelArray); + that._tempValue = s.formatValue(that._tempWheelArray, that); if (that.live) { that._hasValue = manual || that._hasValue; @@ -435,7 +435,7 @@ scrollToPos(time); } - that._tempValue = s.formatValue(that._tempWheelArray); + that._tempValue = s.formatValue(that._tempWheelArray, that); if (!temp) { that._wheelArray = that._tempWheelArray.slice(0); @@ -625,7 +625,7 @@ that._hasValue = true; } - that._tempWheelArray = that._hasValue && that._wheelArray ? that._wheelArray.slice(0) : s.parseValue(v, that) || []; + that._tempWheelArray = that._hasValue && that._wheelArray ? that._wheelArray.slice(0) : s.parseValue.call(el, v, that) || []; setValue(); }; From ef3e4407bcacb8a264bb3d8779a239e7c5b0cefc Mon Sep 17 00:00:00 2001 From: Istvan Halmen Date: Fri, 3 Apr 2015 09:32:22 +0300 Subject: [PATCH 10/10] 2.15.1 version numbers --- bower.json | 2 +- js/mobiscroll.core.js | 4 ++-- mobiscroll.datetime.jquery.json | 2 +- mobiscroll.imageandtext.jquery.json | 2 +- mobiscroll.select.jquery.json | 2 +- mobiscroll.treelist.jquery.json | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/bower.json b/bower.json index 61265ccd..e2e12930 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "mobiscroll", - "version": "2.15.0", + "version": "2.15.1", "main": [ "js/mobiscroll.core.js", "js/mobiscroll.frame.js", diff --git a/js/mobiscroll.core.js b/js/mobiscroll.core.js index 7cd28796..56f85f5a 100644 --- a/js/mobiscroll.core.js +++ b/js/mobiscroll.core.js @@ -1,5 +1,5 @@ /*! - * Mobiscroll v2.15.0 + * Mobiscroll v2.15.1 * http://mobiscroll.com * * Copyright 2010-2015, Acid Media @@ -77,7 +77,7 @@ }; $.mobiscroll = $.mobiscroll || { - version: '2.15.0', + version: '2.15.1', util: { prefix: prefix, jsPrefix: pr, diff --git a/mobiscroll.datetime.jquery.json b/mobiscroll.datetime.jquery.json index 09215dcb..ef14ada6 100644 --- a/mobiscroll.datetime.jquery.json +++ b/mobiscroll.datetime.jquery.json @@ -14,7 +14,7 @@ "scroller", "clickpick" ], - "version": "2.15.0", + "version": "2.15.1", "author": { "name": "Acid Media", "url": "http://theacidmedia.net" diff --git a/mobiscroll.imageandtext.jquery.json b/mobiscroll.imageandtext.jquery.json index 6f36d31e..256a398a 100644 --- a/mobiscroll.imageandtext.jquery.json +++ b/mobiscroll.imageandtext.jquery.json @@ -13,7 +13,7 @@ "scroller", "clickpick" ], - "version": "2.15.0", + "version": "2.15.1", "author": { "name": "Acid Media", "url": "http://theacidmedia.net" diff --git a/mobiscroll.select.jquery.json b/mobiscroll.select.jquery.json index 810a7b72..4facc11a 100644 --- a/mobiscroll.select.jquery.json +++ b/mobiscroll.select.jquery.json @@ -14,7 +14,7 @@ "scroller", "clickpick" ], - "version": "2.15.0", + "version": "2.15.1", "author": { "name": "Acid Media", "url": "http://theacidmedia.net" diff --git a/mobiscroll.treelist.jquery.json b/mobiscroll.treelist.jquery.json index a8fc11e7..fbe4b9a2 100644 --- a/mobiscroll.treelist.jquery.json +++ b/mobiscroll.treelist.jquery.json @@ -13,7 +13,7 @@ "scroller", "clickpick" ], - "version": "2.15.0", + "version": "2.15.1", "author": { "name": "Acid Media", "url": "http://theacidmedia.net"