Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../public_h.../wp-admin/js
File: theme.js
event = event || window.event;
[500] Fix | Delete
[501] Fix | Delete
// Set focus to current theme.
[502] Fix | Delete
themes.focusedTheme = this.$el;
[503] Fix | Delete
[504] Fix | Delete
// Construct a new Preview view.
[505] Fix | Delete
themes.preview = preview = new themes.view.Preview({
[506] Fix | Delete
model: this.model
[507] Fix | Delete
});
[508] Fix | Delete
[509] Fix | Delete
// Render the view and append it.
[510] Fix | Delete
preview.render();
[511] Fix | Delete
this.setNavButtonsState();
[512] Fix | Delete
[513] Fix | Delete
// Hide previous/next navigation if there is only one theme.
[514] Fix | Delete
if ( this.model.collection.length === 1 ) {
[515] Fix | Delete
preview.$el.addClass( 'no-navigation' );
[516] Fix | Delete
} else {
[517] Fix | Delete
preview.$el.removeClass( 'no-navigation' );
[518] Fix | Delete
}
[519] Fix | Delete
[520] Fix | Delete
// Append preview.
[521] Fix | Delete
$( 'div.wrap' ).append( preview.el );
[522] Fix | Delete
[523] Fix | Delete
// Listen to our preview object
[524] Fix | Delete
// for `theme:next` and `theme:previous` events.
[525] Fix | Delete
this.listenTo( preview, 'theme:next', function() {
[526] Fix | Delete
[527] Fix | Delete
// Keep local track of current theme model.
[528] Fix | Delete
current = self.model;
[529] Fix | Delete
[530] Fix | Delete
// If we have ventured away from current model update the current model position.
[531] Fix | Delete
if ( ! _.isUndefined( self.current ) ) {
[532] Fix | Delete
current = self.current;
[533] Fix | Delete
}
[534] Fix | Delete
[535] Fix | Delete
// Get next theme model.
[536] Fix | Delete
self.current = self.model.collection.at( self.model.collection.indexOf( current ) + 1 );
[537] Fix | Delete
[538] Fix | Delete
// If we have no more themes, bail.
[539] Fix | Delete
if ( _.isUndefined( self.current ) ) {
[540] Fix | Delete
self.options.parent.parent.trigger( 'theme:end' );
[541] Fix | Delete
return self.current = current;
[542] Fix | Delete
}
[543] Fix | Delete
[544] Fix | Delete
preview.model = self.current;
[545] Fix | Delete
[546] Fix | Delete
// Render and append.
[547] Fix | Delete
preview.render();
[548] Fix | Delete
this.setNavButtonsState();
[549] Fix | Delete
$( '.next-theme' ).trigger( 'focus' );
[550] Fix | Delete
})
[551] Fix | Delete
.listenTo( preview, 'theme:previous', function() {
[552] Fix | Delete
[553] Fix | Delete
// Keep track of current theme model.
[554] Fix | Delete
current = self.model;
[555] Fix | Delete
[556] Fix | Delete
// Bail early if we are at the beginning of the collection.
[557] Fix | Delete
if ( self.model.collection.indexOf( self.current ) === 0 ) {
[558] Fix | Delete
return;
[559] Fix | Delete
}
[560] Fix | Delete
[561] Fix | Delete
// If we have ventured away from current model update the current model position.
[562] Fix | Delete
if ( ! _.isUndefined( self.current ) ) {
[563] Fix | Delete
current = self.current;
[564] Fix | Delete
}
[565] Fix | Delete
[566] Fix | Delete
// Get previous theme model.
[567] Fix | Delete
self.current = self.model.collection.at( self.model.collection.indexOf( current ) - 1 );
[568] Fix | Delete
[569] Fix | Delete
// If we have no more themes, bail.
[570] Fix | Delete
if ( _.isUndefined( self.current ) ) {
[571] Fix | Delete
return;
[572] Fix | Delete
}
[573] Fix | Delete
[574] Fix | Delete
preview.model = self.current;
[575] Fix | Delete
[576] Fix | Delete
// Render and append.
[577] Fix | Delete
preview.render();
[578] Fix | Delete
this.setNavButtonsState();
[579] Fix | Delete
$( '.previous-theme' ).trigger( 'focus' );
[580] Fix | Delete
});
[581] Fix | Delete
[582] Fix | Delete
this.listenTo( preview, 'preview:close', function() {
[583] Fix | Delete
self.current = self.model;
[584] Fix | Delete
});
[585] Fix | Delete
[586] Fix | Delete
},
[587] Fix | Delete
[588] Fix | Delete
// Handles .disabled classes for previous/next buttons in theme installer preview.
[589] Fix | Delete
setNavButtonsState: function() {
[590] Fix | Delete
var $themeInstaller = $( '.theme-install-overlay' ),
[591] Fix | Delete
current = _.isUndefined( this.current ) ? this.model : this.current,
[592] Fix | Delete
previousThemeButton = $themeInstaller.find( '.previous-theme' ),
[593] Fix | Delete
nextThemeButton = $themeInstaller.find( '.next-theme' );
[594] Fix | Delete
[595] Fix | Delete
// Disable previous at the zero position.
[596] Fix | Delete
if ( 0 === this.model.collection.indexOf( current ) ) {
[597] Fix | Delete
previousThemeButton
[598] Fix | Delete
.addClass( 'disabled' )
[599] Fix | Delete
.prop( 'disabled', true );
[600] Fix | Delete
[601] Fix | Delete
nextThemeButton.trigger( 'focus' );
[602] Fix | Delete
}
[603] Fix | Delete
[604] Fix | Delete
// Disable next if the next model is undefined.
[605] Fix | Delete
if ( _.isUndefined( this.model.collection.at( this.model.collection.indexOf( current ) + 1 ) ) ) {
[606] Fix | Delete
nextThemeButton
[607] Fix | Delete
.addClass( 'disabled' )
[608] Fix | Delete
.prop( 'disabled', true );
[609] Fix | Delete
[610] Fix | Delete
previousThemeButton.trigger( 'focus' );
[611] Fix | Delete
}
[612] Fix | Delete
},
[613] Fix | Delete
[614] Fix | Delete
installTheme: function( event ) {
[615] Fix | Delete
var _this = this;
[616] Fix | Delete
[617] Fix | Delete
event.preventDefault();
[618] Fix | Delete
[619] Fix | Delete
wp.updates.maybeRequestFilesystemCredentials( event );
[620] Fix | Delete
[621] Fix | Delete
$( document ).on( 'wp-theme-install-success', function( event, response ) {
[622] Fix | Delete
if ( _this.model.get( 'id' ) === response.slug ) {
[623] Fix | Delete
_this.model.set( { 'installed': true } );
[624] Fix | Delete
}
[625] Fix | Delete
if ( response.blockTheme ) {
[626] Fix | Delete
_this.model.set( { 'block_theme': true } );
[627] Fix | Delete
}
[628] Fix | Delete
} );
[629] Fix | Delete
[630] Fix | Delete
wp.updates.installTheme( {
[631] Fix | Delete
slug: $( event.target ).data( 'slug' )
[632] Fix | Delete
} );
[633] Fix | Delete
},
[634] Fix | Delete
[635] Fix | Delete
updateTheme: function( event ) {
[636] Fix | Delete
var _this = this;
[637] Fix | Delete
[638] Fix | Delete
if ( ! this.model.get( 'hasPackage' ) ) {
[639] Fix | Delete
return;
[640] Fix | Delete
}
[641] Fix | Delete
[642] Fix | Delete
event.preventDefault();
[643] Fix | Delete
[644] Fix | Delete
wp.updates.maybeRequestFilesystemCredentials( event );
[645] Fix | Delete
[646] Fix | Delete
$( document ).on( 'wp-theme-update-success', function( event, response ) {
[647] Fix | Delete
_this.model.off( 'change', _this.render, _this );
[648] Fix | Delete
if ( _this.model.get( 'id' ) === response.slug ) {
[649] Fix | Delete
_this.model.set( {
[650] Fix | Delete
hasUpdate: false,
[651] Fix | Delete
version: response.newVersion
[652] Fix | Delete
} );
[653] Fix | Delete
}
[654] Fix | Delete
_this.model.on( 'change', _this.render, _this );
[655] Fix | Delete
} );
[656] Fix | Delete
[657] Fix | Delete
wp.updates.updateTheme( {
[658] Fix | Delete
slug: $( event.target ).parents( 'div.theme' ).first().data( 'slug' )
[659] Fix | Delete
} );
[660] Fix | Delete
}
[661] Fix | Delete
});
[662] Fix | Delete
[663] Fix | Delete
// Theme Details view.
[664] Fix | Delete
// Sets up a modal overlay with the expanded theme data.
[665] Fix | Delete
themes.view.Details = wp.Backbone.View.extend({
[666] Fix | Delete
[667] Fix | Delete
// Wrap theme data on a div.theme element.
[668] Fix | Delete
className: 'theme-overlay',
[669] Fix | Delete
[670] Fix | Delete
events: {
[671] Fix | Delete
'click': 'collapse',
[672] Fix | Delete
'click .delete-theme': 'deleteTheme',
[673] Fix | Delete
'click .left': 'previousTheme',
[674] Fix | Delete
'click .right': 'nextTheme',
[675] Fix | Delete
'click #update-theme': 'updateTheme',
[676] Fix | Delete
'click .toggle-auto-update': 'autoupdateState'
[677] Fix | Delete
},
[678] Fix | Delete
[679] Fix | Delete
// The HTML template for the theme overlay.
[680] Fix | Delete
html: themes.template( 'theme-single' ),
[681] Fix | Delete
[682] Fix | Delete
render: function() {
[683] Fix | Delete
var data = this.model.toJSON();
[684] Fix | Delete
this.$el.html( this.html( data ) );
[685] Fix | Delete
// Renders active theme styles.
[686] Fix | Delete
this.activeTheme();
[687] Fix | Delete
// Set up navigation events.
[688] Fix | Delete
this.navigation();
[689] Fix | Delete
// Checks screenshot size.
[690] Fix | Delete
this.screenshotCheck( this.$el );
[691] Fix | Delete
// Contain "tabbing" inside the overlay.
[692] Fix | Delete
this.containFocus( this.$el );
[693] Fix | Delete
},
[694] Fix | Delete
[695] Fix | Delete
// Adds a class to the currently active theme
[696] Fix | Delete
// and to the overlay in detailed view mode.
[697] Fix | Delete
activeTheme: function() {
[698] Fix | Delete
// Check the model has the active property.
[699] Fix | Delete
this.$el.toggleClass( 'active', this.model.get( 'active' ) );
[700] Fix | Delete
},
[701] Fix | Delete
[702] Fix | Delete
// Set initial focus and constrain tabbing within the theme browser modal.
[703] Fix | Delete
containFocus: function( $el ) {
[704] Fix | Delete
[705] Fix | Delete
// Set initial focus on the primary action control.
[706] Fix | Delete
_.delay( function() {
[707] Fix | Delete
$( '.theme-overlay' ).trigger( 'focus' );
[708] Fix | Delete
}, 100 );
[709] Fix | Delete
[710] Fix | Delete
// Constrain tabbing within the modal.
[711] Fix | Delete
$el.on( 'keydown.wp-themes', function( event ) {
[712] Fix | Delete
var $firstFocusable = $el.find( '.theme-header button:not(.disabled)' ).first(),
[713] Fix | Delete
$lastFocusable = $el.find( '.theme-actions a:visible' ).last();
[714] Fix | Delete
[715] Fix | Delete
// Check for the Tab key.
[716] Fix | Delete
if ( 9 === event.which ) {
[717] Fix | Delete
if ( $firstFocusable[0] === event.target && event.shiftKey ) {
[718] Fix | Delete
$lastFocusable.trigger( 'focus' );
[719] Fix | Delete
event.preventDefault();
[720] Fix | Delete
} else if ( $lastFocusable[0] === event.target && ! event.shiftKey ) {
[721] Fix | Delete
$firstFocusable.trigger( 'focus' );
[722] Fix | Delete
event.preventDefault();
[723] Fix | Delete
}
[724] Fix | Delete
}
[725] Fix | Delete
});
[726] Fix | Delete
},
[727] Fix | Delete
[728] Fix | Delete
// Single theme overlay screen.
[729] Fix | Delete
// It's shown when clicking a theme.
[730] Fix | Delete
collapse: function( event ) {
[731] Fix | Delete
var self = this,
[732] Fix | Delete
scroll;
[733] Fix | Delete
[734] Fix | Delete
event = event || window.event;
[735] Fix | Delete
[736] Fix | Delete
// Prevent collapsing detailed view when there is only one theme available.
[737] Fix | Delete
if ( themes.data.themes.length === 1 ) {
[738] Fix | Delete
return;
[739] Fix | Delete
}
[740] Fix | Delete
[741] Fix | Delete
// Detect if the click is inside the overlay and don't close it
[742] Fix | Delete
// unless the target was the div.back button.
[743] Fix | Delete
if ( $( event.target ).is( '.theme-backdrop' ) || $( event.target ).is( '.close' ) || event.keyCode === 27 ) {
[744] Fix | Delete
[745] Fix | Delete
// Add a temporary closing class while overlay fades out.
[746] Fix | Delete
$( 'body' ).addClass( 'closing-overlay' );
[747] Fix | Delete
[748] Fix | Delete
// With a quick fade out animation.
[749] Fix | Delete
this.$el.fadeOut( 130, function() {
[750] Fix | Delete
// Clicking outside the modal box closes the overlay.
[751] Fix | Delete
$( 'body' ).removeClass( 'closing-overlay' );
[752] Fix | Delete
// Handle event cleanup.
[753] Fix | Delete
self.closeOverlay();
[754] Fix | Delete
[755] Fix | Delete
// Get scroll position to avoid jumping to the top.
[756] Fix | Delete
scroll = document.body.scrollTop;
[757] Fix | Delete
[758] Fix | Delete
// Clean the URL structure.
[759] Fix | Delete
themes.router.navigate( themes.router.baseUrl( '' ) );
[760] Fix | Delete
[761] Fix | Delete
// Restore scroll position.
[762] Fix | Delete
document.body.scrollTop = scroll;
[763] Fix | Delete
[764] Fix | Delete
// Return focus to the theme div.
[765] Fix | Delete
if ( themes.focusedTheme ) {
[766] Fix | Delete
themes.focusedTheme.find('.more-details').trigger( 'focus' );
[767] Fix | Delete
}
[768] Fix | Delete
});
[769] Fix | Delete
}
[770] Fix | Delete
},
[771] Fix | Delete
[772] Fix | Delete
// Handles .disabled classes for next/previous buttons.
[773] Fix | Delete
navigation: function() {
[774] Fix | Delete
[775] Fix | Delete
// Disable Left/Right when at the start or end of the collection.
[776] Fix | Delete
if ( this.model.cid === this.model.collection.at(0).cid ) {
[777] Fix | Delete
this.$el.find( '.left' )
[778] Fix | Delete
.addClass( 'disabled' )
[779] Fix | Delete
.prop( 'disabled', true );
[780] Fix | Delete
}
[781] Fix | Delete
if ( this.model.cid === this.model.collection.at( this.model.collection.length - 1 ).cid ) {
[782] Fix | Delete
this.$el.find( '.right' )
[783] Fix | Delete
.addClass( 'disabled' )
[784] Fix | Delete
.prop( 'disabled', true );
[785] Fix | Delete
}
[786] Fix | Delete
},
[787] Fix | Delete
[788] Fix | Delete
// Performs the actions to effectively close
[789] Fix | Delete
// the theme details overlay.
[790] Fix | Delete
closeOverlay: function() {
[791] Fix | Delete
$( 'body' ).removeClass( 'modal-open' );
[792] Fix | Delete
this.remove();
[793] Fix | Delete
this.unbind();
[794] Fix | Delete
this.trigger( 'theme:collapse' );
[795] Fix | Delete
},
[796] Fix | Delete
[797] Fix | Delete
// Set state of the auto-update settings link after it has been changed and saved.
[798] Fix | Delete
autoupdateState: function() {
[799] Fix | Delete
var callback,
[800] Fix | Delete
_this = this;
[801] Fix | Delete
[802] Fix | Delete
// Support concurrent clicks in different Theme Details overlays.
[803] Fix | Delete
callback = function( event, data ) {
[804] Fix | Delete
var autoupdate;
[805] Fix | Delete
if ( _this.model.get( 'id' ) === data.asset ) {
[806] Fix | Delete
autoupdate = _this.model.get( 'autoupdate' );
[807] Fix | Delete
autoupdate.enabled = 'enable' === data.state;
[808] Fix | Delete
_this.model.set( { autoupdate: autoupdate } );
[809] Fix | Delete
$( document ).off( 'wp-auto-update-setting-changed', callback );
[810] Fix | Delete
}
[811] Fix | Delete
};
[812] Fix | Delete
[813] Fix | Delete
// Triggered in updates.js
[814] Fix | Delete
$( document ).on( 'wp-auto-update-setting-changed', callback );
[815] Fix | Delete
},
[816] Fix | Delete
[817] Fix | Delete
updateTheme: function( event ) {
[818] Fix | Delete
var _this = this;
[819] Fix | Delete
event.preventDefault();
[820] Fix | Delete
[821] Fix | Delete
wp.updates.maybeRequestFilesystemCredentials( event );
[822] Fix | Delete
[823] Fix | Delete
$( document ).on( 'wp-theme-update-success', function( event, response ) {
[824] Fix | Delete
if ( _this.model.get( 'id' ) === response.slug ) {
[825] Fix | Delete
_this.model.set( {
[826] Fix | Delete
hasUpdate: false,
[827] Fix | Delete
version: response.newVersion
[828] Fix | Delete
} );
[829] Fix | Delete
}
[830] Fix | Delete
_this.render();
[831] Fix | Delete
} );
[832] Fix | Delete
[833] Fix | Delete
wp.updates.updateTheme( {
[834] Fix | Delete
slug: $( event.target ).data( 'slug' )
[835] Fix | Delete
} );
[836] Fix | Delete
},
[837] Fix | Delete
[838] Fix | Delete
deleteTheme: function( event ) {
[839] Fix | Delete
var _this = this,
[840] Fix | Delete
_collection = _this.model.collection,
[841] Fix | Delete
_themes = themes;
[842] Fix | Delete
event.preventDefault();
[843] Fix | Delete
[844] Fix | Delete
// Confirmation dialog for deleting a theme.
[845] Fix | Delete
if ( ! window.confirm( wp.themes.data.settings.confirmDelete ) ) {
[846] Fix | Delete
return;
[847] Fix | Delete
}
[848] Fix | Delete
[849] Fix | Delete
wp.updates.maybeRequestFilesystemCredentials( event );
[850] Fix | Delete
[851] Fix | Delete
$( document ).one( 'wp-theme-delete-success', function( event, response ) {
[852] Fix | Delete
_this.$el.find( '.close' ).trigger( 'click' );
[853] Fix | Delete
$( '[data-slug="' + response.slug + '"]' ).css( { backgroundColor:'#faafaa' } ).fadeOut( 350, function() {
[854] Fix | Delete
$( this ).remove();
[855] Fix | Delete
_themes.data.themes = _.without( _themes.data.themes, _.findWhere( _themes.data.themes, { id: response.slug } ) );
[856] Fix | Delete
[857] Fix | Delete
$( '.wp-filter-search' ).val( '' );
[858] Fix | Delete
_collection.doSearch( '' );
[859] Fix | Delete
_collection.remove( _this.model );
[860] Fix | Delete
_collection.trigger( 'themes:update' );
[861] Fix | Delete
} );
[862] Fix | Delete
} );
[863] Fix | Delete
[864] Fix | Delete
wp.updates.deleteTheme( {
[865] Fix | Delete
slug: this.model.get( 'id' )
[866] Fix | Delete
} );
[867] Fix | Delete
},
[868] Fix | Delete
[869] Fix | Delete
nextTheme: function() {
[870] Fix | Delete
var self = this;
[871] Fix | Delete
self.trigger( 'theme:next', self.model.cid );
[872] Fix | Delete
return false;
[873] Fix | Delete
},
[874] Fix | Delete
[875] Fix | Delete
previousTheme: function() {
[876] Fix | Delete
var self = this;
[877] Fix | Delete
self.trigger( 'theme:previous', self.model.cid );
[878] Fix | Delete
return false;
[879] Fix | Delete
},
[880] Fix | Delete
[881] Fix | Delete
// Checks if the theme screenshot is the old 300px width version
[882] Fix | Delete
// and adds a corresponding class if it's true.
[883] Fix | Delete
screenshotCheck: function( el ) {
[884] Fix | Delete
var screenshot, image;
[885] Fix | Delete
[886] Fix | Delete
screenshot = el.find( '.screenshot img' );
[887] Fix | Delete
image = new Image();
[888] Fix | Delete
image.src = screenshot.attr( 'src' );
[889] Fix | Delete
[890] Fix | Delete
// Width check.
[891] Fix | Delete
if ( image.width && image.width <= 300 ) {
[892] Fix | Delete
el.addClass( 'small-screenshot' );
[893] Fix | Delete
}
[894] Fix | Delete
}
[895] Fix | Delete
});
[896] Fix | Delete
[897] Fix | Delete
// Theme Preview view.
[898] Fix | Delete
// Sets up a modal overlay with the expanded theme data.
[899] Fix | Delete
themes.view.Preview = themes.view.Details.extend({
[900] Fix | Delete
[901] Fix | Delete
className: 'wp-full-overlay expanded',
[902] Fix | Delete
el: '.theme-install-overlay',
[903] Fix | Delete
[904] Fix | Delete
events: {
[905] Fix | Delete
'click .close-full-overlay': 'close',
[906] Fix | Delete
'click .collapse-sidebar': 'collapse',
[907] Fix | Delete
'click .devices button': 'previewDevice',
[908] Fix | Delete
'click .previous-theme': 'previousTheme',
[909] Fix | Delete
'click .next-theme': 'nextTheme',
[910] Fix | Delete
'keyup': 'keyEvent',
[911] Fix | Delete
'click .theme-install': 'installTheme'
[912] Fix | Delete
},
[913] Fix | Delete
[914] Fix | Delete
// The HTML template for the theme preview.
[915] Fix | Delete
html: themes.template( 'theme-preview' ),
[916] Fix | Delete
[917] Fix | Delete
render: function() {
[918] Fix | Delete
var self = this,
[919] Fix | Delete
currentPreviewDevice,
[920] Fix | Delete
data = this.model.toJSON(),
[921] Fix | Delete
$body = $( document.body );
[922] Fix | Delete
[923] Fix | Delete
$body.attr( 'aria-busy', 'true' );
[924] Fix | Delete
[925] Fix | Delete
this.$el.removeClass( 'iframe-ready' ).html( this.html( data ) );
[926] Fix | Delete
[927] Fix | Delete
currentPreviewDevice = this.$el.data( 'current-preview-device' );
[928] Fix | Delete
if ( currentPreviewDevice ) {
[929] Fix | Delete
self.togglePreviewDeviceButtons( currentPreviewDevice );
[930] Fix | Delete
}
[931] Fix | Delete
[932] Fix | Delete
themes.router.navigate( themes.router.baseUrl( themes.router.themePath + this.model.get( 'id' ) ), { replace: false } );
[933] Fix | Delete
[934] Fix | Delete
this.$el.fadeIn( 200, function() {
[935] Fix | Delete
$body.addClass( 'theme-installer-active full-overlay-active' );
[936] Fix | Delete
});
[937] Fix | Delete
[938] Fix | Delete
this.$el.find( 'iframe' ).one( 'load', function() {
[939] Fix | Delete
self.iframeLoaded();
[940] Fix | Delete
});
[941] Fix | Delete
},
[942] Fix | Delete
[943] Fix | Delete
iframeLoaded: function() {
[944] Fix | Delete
this.$el.addClass( 'iframe-ready' );
[945] Fix | Delete
$( document.body ).attr( 'aria-busy', 'false' );
[946] Fix | Delete
},
[947] Fix | Delete
[948] Fix | Delete
close: function() {
[949] Fix | Delete
this.$el.fadeOut( 200, function() {
[950] Fix | Delete
$( 'body' ).removeClass( 'theme-installer-active full-overlay-active' );
[951] Fix | Delete
[952] Fix | Delete
// Return focus to the theme div.
[953] Fix | Delete
if ( themes.focusedTheme ) {
[954] Fix | Delete
themes.focusedTheme.find('.more-details').trigger( 'focus' );
[955] Fix | Delete
}
[956] Fix | Delete
}).removeClass( 'iframe-ready' );
[957] Fix | Delete
[958] Fix | Delete
// Restore the previous browse tab if available.
[959] Fix | Delete
if ( themes.router.selectedTab ) {
[960] Fix | Delete
themes.router.navigate( themes.router.baseUrl( '?browse=' + themes.router.selectedTab ) );
[961] Fix | Delete
themes.router.selectedTab = false;
[962] Fix | Delete
} else {
[963] Fix | Delete
themes.router.navigate( themes.router.baseUrl( '' ) );
[964] Fix | Delete
}
[965] Fix | Delete
this.trigger( 'preview:close' );
[966] Fix | Delete
this.undelegateEvents();
[967] Fix | Delete
this.unbind();
[968] Fix | Delete
return false;
[969] Fix | Delete
},
[970] Fix | Delete
[971] Fix | Delete
collapse: function( event ) {
[972] Fix | Delete
var $button = $( event.currentTarget );
[973] Fix | Delete
if ( 'true' === $button.attr( 'aria-expanded' ) ) {
[974] Fix | Delete
$button.attr({ 'aria-expanded': 'false', 'aria-label': l10n.expandSidebar });
[975] Fix | Delete
} else {
[976] Fix | Delete
$button.attr({ 'aria-expanded': 'true', 'aria-label': l10n.collapseSidebar });
[977] Fix | Delete
}
[978] Fix | Delete
[979] Fix | Delete
this.$el.toggleClass( 'collapsed' ).toggleClass( 'expanded' );
[980] Fix | Delete
return false;
[981] Fix | Delete
},
[982] Fix | Delete
[983] Fix | Delete
previewDevice: function( event ) {
[984] Fix | Delete
var device = $( event.currentTarget ).data( 'device' );
[985] Fix | Delete
[986] Fix | Delete
this.$el
[987] Fix | Delete
.removeClass( 'preview-desktop preview-tablet preview-mobile' )
[988] Fix | Delete
.addClass( 'preview-' + device )
[989] Fix | Delete
.data( 'current-preview-device', device );
[990] Fix | Delete
[991] Fix | Delete
this.togglePreviewDeviceButtons( device );
[992] Fix | Delete
},
[993] Fix | Delete
[994] Fix | Delete
togglePreviewDeviceButtons: function( newDevice ) {
[995] Fix | Delete
var $devices = $( '.wp-full-overlay-footer .devices' );
[996] Fix | Delete
[997] Fix | Delete
$devices.find( 'button' )
[998] Fix | Delete
.removeClass( 'active' )
[999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function