Opportunity html

From Redazione
Jump to navigation Jump to search
Line 1,943: Line 1,943:
  
  
 +
$( function () {
 +
var demo, lastQuery = location.search;
  
 +
OO.ui.isDemo = true;
  
$( function () {
+
function setup() {
 +
var prevPage = demo ? demo.mode.page : null,
 +
scrollPos = $( window ).scrollTop();
 +
if ( demo ) {
 +
if ( lastQuery === location.search ) {
 +
return false;
 +
}
 +
demo.destroy();
 +
}
 +
lastQuery = location.search;
 +
demo = new Demo();
 +
$( document.body ).append( demo.$element );
 +
demo.initialize().done( function () {
 +
if ( prevPage === demo.mode.page && scrollPos ) {
 +
// Restore scroll position from before we destroyed the demo
 +
$( window ).scrollTop( scrollPos );
 +
}
 +
} );
 +
}
  
 
setup();
 
setup();
 +
 +
OO.ui.demo = demo;
  
 
$( window ).on( 'popstate', setup );
 
$( window ).on( 'popstate', setup );

Revision as of 01:30, 1 March 2020

{{#ci_enable_OOUI:}}