Commit 0ea054ab authored by Sven Franck's avatar Sven Franck

enable search-param reloads in jQM

parent fa897fd0
...@@ -4740,6 +4740,13 @@ $.widget( "mobile.page", { ...@@ -4740,6 +4740,13 @@ $.widget( "mobile.page", {
return; return;
} }
// if it is the first page, allow to override query parameters
// TODO: calling isFirstPageUrl a lot here.
if ( content.length === 1 &&
path.isFirstPageUrl(fileUrl) ) {
settings.isFirst = true;
}
// Reset base to the default document base // Reset base to the default document base
// TODO figure out why we doe this // TODO figure out why we doe this
this._getBase().reset(); this._getBase().reset();
...@@ -4914,7 +4921,7 @@ $.widget( "mobile.page", { ...@@ -4914,7 +4921,7 @@ $.widget( "mobile.page", {
// store the original absolute url so that it can be provided // store the original absolute url so that it can be provided
// to events in the triggerData of the subsequent changePage call // to events in the triggerData of the subsequent changePage call
options.absUrl = triggerData.absUrl; options.absUrl = options.isFirst ? url : triggerData.absUrl;
this.transition( content, triggerData, options ); this.transition( content, triggerData, options );
}, this)); }, this));
...@@ -5040,7 +5047,7 @@ $.widget( "mobile.page", { ...@@ -5040,7 +5047,7 @@ $.widget( "mobile.page", {
// us to avoid generating a document url with an id hash in the case where the // us to avoid generating a document url with an id hash in the case where the
// first-page of the document has an id attribute specified. // first-page of the document has an id attribute specified.
if ( toPage[ 0 ] === $.mobile.firstPage[ 0 ] && !settings.dataUrl ) { if ( toPage[ 0 ] === $.mobile.firstPage[ 0 ] && !settings.dataUrl ) {
settings.dataUrl = documentUrl.hrefNoHash; settings.dataUrl = settings.isFirst ? settings.absUrl : documentUrl.hrefNoHash;
} }
// The caller passed us a real page DOM element. Update our // The caller passed us a real page DOM element. Update our
...@@ -5272,7 +5279,9 @@ $.widget( "mobile.page", { ...@@ -5272,7 +5279,9 @@ $.widget( "mobile.page", {
var u = path.parseUrl( path.makeUrlAbsolute( url, this.documentBase ) ), var u = path.parseUrl( path.makeUrlAbsolute( url, this.documentBase ) ),
// Does the url have the same path as the document? // Does the url have the same path as the document?
samePath = u.hrefNoHash === this.documentUrl.hrefNoHash || ( this.documentBaseDiffers && u.hrefNoHash === this.documentBase.hrefNoHash ), samePath = u.hrefNoHash === this.documentUrl.hrefNoHash ||
u.hrefNoSearch === this.documentUrl.hrefNoSearch ||
( this.documentBaseDiffers && u.hrefNoHash === this.documentBase.hrefNoHash ),
// Get the first page element. // Get the first page element.
fp = $.mobile.firstPage, fp = $.mobile.firstPage,
...@@ -7315,10 +7324,8 @@ $.mobile._enhancer.add( "mobile.textinput" ); ...@@ -7315,10 +7324,8 @@ $.mobile._enhancer.add( "mobile.textinput" );
_completeTransition: function (current, next, events) { _completeTransition: function (current, next, events) {
var self = this, var self = this,
o = self.options; o = self.options;
console.log("3. NEXT: removing 'in out slide'")
next.removeClass("in out " + o.carouseltransition) next.removeClass("in out " + o.carouseltransition)
.off( events ); .off( events );
console.log("4. CURRENT: setting bindings");
current current
.on( events, self._cleanupTransition(current, events) ) .on( events, self._cleanupTransition(current, events) )
}, },
...@@ -7327,9 +7334,7 @@ $.mobile._enhancer.add( "mobile.textinput" ); ...@@ -7327,9 +7334,7 @@ $.mobile._enhancer.add( "mobile.textinput" );
var self = this, var self = this,
o = self.options; o = self.options;
var classes = o.carouseltransition + " out in"; var classes = o.carouseltransition + " out in";
console.log("5. CURRENT: removing 'in out slide'");
current.removeClass(classes) current.removeClass(classes)
console.log("6. CURRENT: removing 'active'");
current.removeClass("ui-carousel-active").off(events); current.removeClass("ui-carousel-active").off(events);
}, },
...@@ -7353,8 +7358,6 @@ $.mobile._enhancer.add( "mobile.textinput" ); ...@@ -7353,8 +7358,6 @@ $.mobile._enhancer.add( "mobile.textinput" );
// initialize // initialize
nextActive nextActive
.on( events, self._completeTransition(currentActive, nextActive, events)); .on( events, self._completeTransition(currentActive, nextActive, events));
console.log("2. NEXT: adding 'slide in active'");
nextActive nextActive
.addClass(transition + " ui-carousel-active in "); .addClass(transition + " ui-carousel-active in ");
...@@ -9096,15 +9099,6 @@ $.mobile._enhancer.add( "mobile.rangeslider", { dependencies: [ "mobile.slider" ...@@ -9096,15 +9099,6 @@ $.mobile._enhancer.add( "mobile.rangeslider", { dependencies: [ "mobile.slider"
}, },
_clearBtnClick: function( event ){
this.element.val( "" )
.focus()
.trigger( "change" );
this._actionBtn.addClass( "ui-input-clear-hidden" );
event.preventDefault();
},
_addActionBtn: function(){ _addActionBtn: function(){
if( !this.options.enhanced ) { if( !this.options.enhanced ) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment