Specified more dependencies

This commit is contained in:
Ghislain Seguin 2011-12-15 13:07:55 -08:00 committed by scottjehl
parent 6f13267af7
commit f3e3121166
16 changed files with 38 additions and 23 deletions

View file

@ -2,7 +2,7 @@
* "buttons" plugin - for making button-like links
*/
define( [ "jquery", "jquery.mobile.vmouse" ], function( $, undefined ) {
define( [ "jquery.mobile.core", "jquery.mobile.vmouse" ], function() {
$.fn.buttonMarkup = function( options ) {
options = options || {};
@ -76,6 +76,7 @@ $.fn.buttonMarkup = function( options ) {
el.removeClass( "ui-link" ).addClass( buttonClass );
buttonInner.className = innerClass;
buttonInner.setAttribute("aria-hidden", "true");
buttonText.className = textClass;
buttonInner.appendChild( buttonText );

View file

@ -2,7 +2,7 @@
* "collapsible" plugin
*/
define( [ "jquery", "jquery.mobile.widget", "jquery.mobile.buttonMarkup" ], function( $, undefined ) {
define( [ "jquery.mobile.widget" ], function() {
$.widget( "mobile.collapsible", $.mobile.widget, {
options: {

View file

@ -2,7 +2,7 @@
* "controlgroup" plugin - corner-rounding for groups of buttons, checks, radios, etc
*/
define( [ "jquery" ], function( $, undefined ) {
define( [ "jquery.mobile.buttonMarkup" ], function() {
$.fn.controlgroup = function( options ) {

View file

@ -7,7 +7,7 @@ define( [ "jquery" ], function( $, undefined ) {
var nsNormalizeDict = {};
// jQuery.mobile configurable options
$.extend( $.mobile, {
$.extend( { mobile: {
// Namespace used framework-wide for data-attrs. Default is no namespace
ns: "",
@ -174,7 +174,7 @@ define( [ "jquery" ], function( $, undefined ) {
.closest(':jqmData(role="page"), :jqmData(role="dialog")')
.data("page");
}
});
}});
// Mobile version of data and removeData and hasData methods
// ensures all data is set and retrieved using jQuery Mobile's data namespace

View file

@ -2,7 +2,7 @@
* "events" plugin - Handles events
*/
define( [ "jquery", "jquery.mobile.support", "jquery.mobile.vmouse" ], function( $, undefined ) {
define( [ "jquery.mobile.core", "jquery.mobile.support", "jquery.mobile.vmouse" ], function() {
// add new event shortcuts
$.each( ( "touchstart touchmove touchend orientationchange throttledresize " +

View file

@ -2,7 +2,7 @@
* "checkboxradio" plugin
*/
define( [ "jquery", "jquery.mobile.widget", "jquery.mobile.buttonMarkup", "jquery.mobile.vmouse" ], function( $, undefined ) {
define( [ "jquery.mobile.core", "jquery.mobile.widget" ], function() {
$.widget( "mobile.checkboxradio", $.mobile.widget, {
options: {

View file

@ -2,7 +2,7 @@
* custom "selectmenu" plugin
*/
define( [ "jquery", "jquery.mobile.forms.select", "jquery.mobile.buttonMarkup" ], function( $, undefined ) {
define( [ "jquery.mobile.core", "jquery.mobile.forms.select" ], function() {
var extendSelect = function( widget ){
var select = widget.select,

View file

@ -2,7 +2,7 @@
* "selectmenu" plugin
*/
define( [ "jquery", "jquery.mobile.widget", "jquery.mobile.buttonMarkup", "jquery.mobile.vmouse" ], function( $, undefined ) {
define( [ "jquery.mobile.core", "jquery.mobile.widget" ], function() {
$.widget( "mobile.selectmenu", $.mobile.widget, {
options: {

View file

@ -2,7 +2,7 @@
* "slider" plugin
*/
define( [ "jquery", "jquery.mobile.widget", "jquery.mobile.buttonMarkup", "jquery.mobile.vmouse" ], function( $, undefined ) {
define( [ "jquery.mobile.core", "jquery.mobile.widget", "jquery.mobile.forms.textInput" ], function() {
$.widget( "mobile.slider", $.mobile.widget, {
options: {

View file

@ -2,7 +2,7 @@
* "textinput" plugin for text inputs, textareas
*/
define( [ "jquery", "jquery.mobile.widget", "jquery.mobile.buttonMarkup" ], function( $, undefined ) {
define( [ "jquery.mobile.core", "jquery.mobile.widget", "jquery.mobile.degradeInputs" ], function() {
$.widget( "mobile.textinput", $.mobile.widget, {
options: {

View file

@ -2,7 +2,7 @@
* "init" - Initialize the framework
*/
define( [ "jquery", "jquery.mobile.core", "jquery.mobile.navigation" ], function( $, undefined ) {
define( [ "jquery.mobile.core", "jquery.mobile.navigation", "jquery.mobile.navigation.pushState" ], function() {
var $html = $( "html" ),
$head = $( "head" ),
$window = $( window );
@ -98,6 +98,24 @@ define( [ "jquery", "jquery.mobile.core", "jquery.mobile.navigation" ], function
}
}
});
// This function injects a meta viewport tag to prevent scaling. Off by default, on by default when touchOverflow scrolling is enabled
function disableZoom() {
var cont = "user-scalable=no",
meta = $( "meta[name='viewport']" );
if( meta.length ){
meta.attr( "content", meta.attr( "content" ) + ", " + cont );
}
else{
$( "head" ).prepend( "<meta>", { "name": "viewport", "content": cont } );
}
}
// if touch-overflow is enabled, disable user scaling, as it creates usability issues
if( $.support.touchOverflow && $.mobile.touchOverflowEnabled && !$.mobile.touchOverflowZoomEnabled ){
disableZoom();
}
// initialize events now, after mobileinit has occurred
$.mobile._registerInternalEvents();

View file

@ -2,7 +2,7 @@
* "links" plugin - simple class additions for links
*/
define( [ "jquery" ], function( $, undefined ) {
define( function() {
$( document ).bind( "pagecreate create", function( e ){

View file

@ -2,7 +2,7 @@
* "listview" plugin
*/
define( [ "jquery", "jquery.mobile.widget", "jquery.mobile.buttonMarkup" ], function( $, undefined ) {
define( [ "jquery.mobile.widget" ], function() {
//Keeps track of the number of lists per page UID
//This allows support for multiple nested list in the same page

View file

@ -2,7 +2,7 @@
* "navbar" plugin
*/
define( [ "jquery", "jquery.mobile.widget", "jquery.mobile.buttonMarkup" ], function( $, undefined ) {
define( [ "jquery.mobile.widget" ], function() {
$.widget( "mobile.navbar", $.mobile.widget, {
options: {

View file

@ -2,7 +2,7 @@
* core utilities for auto ajax navigation, base tag mgmt,
*/
define( [ "jquery", "jquery.mobile.core", "jquery.mobile.hashchange", "jquery.mobile.event" ], function( $, undefined ) {
define( [ "jquery.mobile.core", "jquery.mobile.hashchange", "jquery.mobile.event", "jquery.mobile.page" ], function() {
//define vars for interal use
var $window = $( window ),
@ -536,6 +536,8 @@ define( [ "jquery", "jquery.mobile.core", "jquery.mobile.hashchange", "jquery.mo
//reset toPage height back
if( !touchOverflow ){
toPage.height( "" );
// Send focus to the newly shown page
reFocus( toPage );
}
// Jump to top or prev scroll, sometimes on iOS the page has not rendered yet.
@ -1164,12 +1166,6 @@ define( [ "jquery", "jquery.mobile.core", "jquery.mobile.hashchange", "jquery.mo
//remove initial build class (only present on first pageshow)
$html.removeClass( "ui-mobile-rendering" );
// Send focus to the newly shown page. Moved from promise .done binding in transitionPages
// itself to avoid ie bug that reports offsetWidth as > 0 (core check for visibility)
// despite visibility: hidden addresses issue #2965
// https://github.com/jquery/jquery-mobile/issues/2965
reFocus( toPage );
releasePageTransitionLock();
// Let listeners know we're all done changing the current page.

View file

@ -2,7 +2,7 @@
* This plugin handles theming and layout of headers, footers, and content areas
*/
define( [ "jquery", "jquery.mobile.page" ], function( $, undefined ) {
define( [ "jquery.mobile.page", "jquery.mobile.core" ], function() {
$.mobile.page.prototype.options.backBtnText = "Back";
$.mobile.page.prototype.options.addBackBtn = false;