Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Cached jquery window #6751

Closed
wants to merge 3 commits into from

4 participants

@stforek

It turns out that $(window) is still used in some places in code. This small commit fixes them.

stforek added some commits
@stforek stforek Orientationchange: use cached jquery window
Panel: use cached jquery window
Loader: chain jquery window
f99acf6
@stforek stforek Core: use cached jquery document
Vmouse: use cached jquery document
Touch: use cached jquery document
Navbar: use widget.document
51c2e3b
@arschmitz

This module can be used without the rest of jQuery mobile it is stand alone so it cant rely on $.mobile.window

@arschmitz

this is a stand alone module the does not depend on the rest of mobile there for this cannot rely on $.mobile.documemt

@arschmitz

this is a stand alone module the does not depend on the rest of mobile there for this cannot rely on $.mobile.documemt

@stforek stforek Remove dependencies on jquery.mobile.helpers for standalone modules
e286b24
@Ruffio

Should this PR be closed (and not merged) as it can't be accepted or what what would it take to merge this PR?

@jaspermdegroot jaspermdegroot added this to the 1.5.0 milestone
@jaspermdegroot
Collaborator

@Ruffio - If @stforek updates the PR based on the first feedback we can review it again.

@arschmitz
Owner

The changes in this pr look good now but we will have to rebase and test it since its so old.

@arschmitz arschmitz self-assigned this
@arschmitz
Owner

Bumping this to take care of myself

@arschmitz arschmitz closed this pull request from a commit
@stforek stforek Init: Use cached window object
Closes gh-6751
8cdc1b0
@arschmitz arschmitz closed this in 8cdc1b0
@kapilgarg1996 kapilgarg1996 referenced this pull request from a commit in kapilgarg1996/jquery-mobile
@stforek stforek Init: Use cached window object
Closes gh-6751
36acac5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 20, 2013
  1. @stforek

    Orientationchange: use cached jquery window

    stforek authored
    Panel: use cached jquery window
    Loader: chain jquery window
Commits on Nov 21, 2013
  1. @stforek

    Core: use cached jquery document

    stforek authored
    Vmouse: use cached jquery document
    Touch: use cached jquery document
    Navbar: use widget.document
Commits on Nov 27, 2013
  1. @stforek

    Remove dependencies on jquery.mobile.helpers for standalone modules

    stforek authored
This page is out of date. Refresh to see the latest.
View
2  js/jquery.mobile.init.js
@@ -28,7 +28,7 @@ define([
}
// trigger mobileinit event - useful hook for configuring $.mobile settings before they're used
- $( window.document ).trigger( "mobileinit" );
+ $.mobile.document.trigger( "mobileinit" );
// support conditions
// if device support condition(s) aren't met, leave things as they are -> a basic, usable experience,
View
5 js/widgets/loader.js
@@ -131,8 +131,9 @@ define( [ "jquery", "../jquery.mobile.core", "../jquery.mobile.widget" ], functi
this.element.removeClass( "ui-loader-fakefix" );
}
- $.mobile.window.unbind( "scroll", this.fakeFixLoader );
- $.mobile.window.unbind( "scroll", this.checkLoaderPosition );
+ this.window
+ .unbind( "scroll", this.fakeFixLoader )
+ .unbind( "scroll", this.checkLoaderPosition );
}
});
View
3  js/widgets/navbar.js
@@ -18,6 +18,7 @@ $.widget( "mobile.navbar", {
_create: function() {
var $navbar = this.element,
+ self = this,
$navbtns = $navbar.find( "a" ),
iconpos = $navbtns.filter( ":jqmData(icon)" ).length ? this.options.iconpos : undefined;
@@ -56,7 +57,7 @@ $.widget( "mobile.navbar", {
activeBtn.addClass( $.mobile.activeBtnClass );
// The code below is a workaround to fix #1181
- $( document ).one( "pagehide", function() {
+ self.document.one( "pagehide", function() {
activeBtn.removeClass( $.mobile.activeBtnClass );
});
}
View
4 js/widgets/panel.js
@@ -175,11 +175,11 @@ $.widget( "mobile.panel", {
},
_bindFixListener: function() {
- this._on( $( window ), { "throttledresize": "_positionPanel" });
+ this._on( this.window, { "throttledresize": "_positionPanel" });
},
_unbindFixListener: function() {
- this._off( $( window ), "throttledresize" );
+ this._off( this.window, "throttledresize" );
},
_unfixPanel: function() {
Something went wrong with that request. Please try again.