From 4ca2fc5287f731f84c9cda7e2503bcadffe6cc71 Mon Sep 17 00:00:00 2001 From: Shana Golden Date: Wed, 25 May 2011 15:45:41 -0400 Subject: [PATCH 1/4] Allow checkboxes and radio buttons to be selected with the keyboard --- js/jquery.mobile.forms.checkboxradio.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/js/jquery.mobile.forms.checkboxradio.js b/js/jquery.mobile.forms.checkboxradio.js index 61c2385a..70834f8f 100644 --- a/js/jquery.mobile.forms.checkboxradio.js +++ b/js/jquery.mobile.forms.checkboxradio.js @@ -58,8 +58,8 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, { } self._cacheVals(); - - input.attr( "checked", inputtype === "radio" && true || !input.is( ":checked" ) ); + + input.attr( "checked", inputtype === "radio" && true || !(input.attr("checked")) ); // input set for common radio buttons will contain all the radio // buttons, but will not for checkboxes. clearing the checked status @@ -79,6 +79,13 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, { }, vclick: function(){ + // adds checked attribute to checked input when keyboard is used + if ($(this).is(":checked")) { + $(this).attr( "checked", true); + self._getInputSet().not($(this)).removeAttr('checked'); + } else { + $(this).removeAttr("checked"); + } self._updateAll(); }, From b2a534c217a4fa18918002a43db17bbdcd0a2a42 Mon Sep 17 00:00:00 2001 From: eddiemonge Date: Thu, 26 May 2011 16:43:07 -0700 Subject: [PATCH 2/4] fix height issue for transitioning page --- themes/default/jquery.mobile.core.css | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/themes/default/jquery.mobile.core.css b/themes/default/jquery.mobile.core.css index 16b74f1f..982b18dc 100644 --- a/themes/default/jquery.mobile.core.css +++ b/themes/default/jquery.mobile.core.css @@ -14,14 +14,14 @@ .ui-mobile-viewport { margin: 0; overflow-x: hidden; -webkit-text-size-adjust: none; -ms-text-size-adjust:none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } /* "page" containers - full-screen views, one should always be in view post-pageload */ -.ui-mobile [data-role=page], .ui-mobile [data-role=dialog], .ui-page { top: 0; left: 0; width: 100%; min-height: 100%; position: absolute; display: none; border: 0; } +.ui-mobile [data-role=page], .ui-mobile [data-role=dialog], .ui-page { top: 0; left: 0; width: 100%; min-height: 100%; height: auto !important; height: 100%; position: absolute; display: none; border: 0; } .ui-mobile .ui-page-active { display: block; overflow: visible; } /*orientations from js are available */ .portrait, -.portrait .ui-page { min-height: 100%; } +.portrait .ui-page, .landscape, -.landscape .ui-page { min-height: 100%; } +.landscape .ui-page { min-height: 100%; height: auto !important; height: 100%; } /* loading screen */ .ui-loading .ui-mobile-viewport { overflow: hidden !important; } From 7a01d702ef624dcdf13994ffe429ad772256b29a Mon Sep 17 00:00:00 2001 From: eddiemonge Date: Thu, 26 May 2011 16:49:05 -0700 Subject: [PATCH 3/4] trying to sneak this in as well --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 34953852..9494835e 100644 --- a/Makefile +++ b/Makefile @@ -110,7 +110,7 @@ init: # Build the minified JS file min: init js - # Build the minified Javascript file + # Build the minified JavaScript file @@head -8 js/jquery.mobile.core.js | ${SED_VER} > ${OUTPUT}/${MIN} @@java -jar build/google-compiler-20110405.jar --js ${OUTPUT}/${JS} --warning_level QUIET --js_output_file ${MIN}.tmp @@cat ${MIN}.tmp >> ${OUTPUT}/${MIN} From c9d97ef2614e18556275c3c4f94b93db1a47186a Mon Sep 17 00:00:00 2001 From: Shana Golden Date: Fri, 27 May 2011 09:50:54 -0400 Subject: [PATCH 4/4] Allow checkboxes/radio buttons to be selected with keyboard - updated to use prop() --- js/jquery.mobile.forms.checkboxradio.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/js/jquery.mobile.forms.checkboxradio.js b/js/jquery.mobile.forms.checkboxradio.js index 70834f8f..1dacb908 100644 --- a/js/jquery.mobile.forms.checkboxradio.js +++ b/js/jquery.mobile.forms.checkboxradio.js @@ -59,12 +59,12 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, { self._cacheVals(); - input.attr( "checked", inputtype === "radio" && true || !(input.attr("checked")) ); + input.prop( "checked", inputtype === "radio" && true || !(input.prop("checked")) ); // input set for common radio buttons will contain all the radio // buttons, but will not for checkboxes. clearing the checked status // of other radios ensures the active button state is applied properly - self._getInputSet().not(input).removeAttr('checked'); + self._getInputSet().not(input).prop('checked', false); self._updateAll(); return false; @@ -81,10 +81,10 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, { vclick: function(){ // adds checked attribute to checked input when keyboard is used if ($(this).is(":checked")) { - $(this).attr( "checked", true); - self._getInputSet().not($(this)).removeAttr('checked'); + $(this).prop( "checked", true); + self._getInputSet().not($(this)).prop('checked', false); } else { - $(this).removeAttr("checked"); + $(this).prop("checked", false); } self._updateAll(); }, @@ -132,7 +132,7 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, { // input[0].checked expando doesn't always report the proper value // for checked='checked' - if ( $(input[0]).attr('checked') ) { + if ( $(input[0]).prop('checked') ) { label.addClass( $.mobile.activeBtnClass ); icon.addClass( this.checkedicon ).removeClass( this.uncheckedicon );