Gerrit Patch Uploader has uploaded a new change for review.
https://gerrit.wikimedia.org/r/268968
Change subject: Remove deferLoad of the toolbar
......................................................................
Remove deferLoad of the toolbar
Since e8d37102 the loading of the toolbar is fast. A deferred loading is not
necessary.
The deferLoad is buggy because it reexecutes the generating on every click.
Bug: T126138
Change-Id: I49909ef35b87ce9091cf9897f278adcc420c14aa
---
M modules/jquery.wikiEditor.toolbar.config.js
M modules/jquery.wikiEditor.toolbar.js
M modules/jquery.wikiEditor.toolbar.less
3 files changed, 5 insertions(+), 40 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikiEditor
refs/changes/68/268968/1
diff --git a/modules/jquery.wikiEditor.toolbar.config.js
b/modules/jquery.wikiEditor.toolbar.config.js
index 35eddc0..62e5f83 100644
--- a/modules/jquery.wikiEditor.toolbar.config.js
+++ b/modules/jquery.wikiEditor.toolbar.config.js
@@ -474,7 +474,6 @@
characters: {
labelMsg:
'wikieditor-toolbar-section-characters',
type: 'booklet',
- deferLoad: true,
pages: {
latin: {
labelMsg:
'special-characters-group-latin',
@@ -589,7 +588,6 @@
help: {
labelMsg:
'wikieditor-toolbar-section-help',
type: 'booklet',
- deferLoad: true,
pages: {
format: {
labelMsg:
'wikieditor-toolbar-help-page-format',
diff --git a/modules/jquery.wikiEditor.toolbar.js
b/modules/jquery.wikiEditor.toolbar.js
index 0bcbec1..49149b8 100644
--- a/modules/jquery.wikiEditor.toolbar.js
+++ b/modules/jquery.wikiEditor.toolbar.js
@@ -441,20 +441,12 @@
return false;
} );
},
- buildPage: function ( context, id, page, deferLoad ) {
+ buildPage: function ( context, id, page ) {
var $page = $( '<div>' ).attr( {
'class': 'page page-' + id,
rel: id
} );
- if ( deferLoad ) {
- $page.addClass( 'loading' ).append( $( '<div>'
).addClass( 'spinner' ) );
- $page.bind( 'loadPage', function () {
-
$.wikiEditor.modules.toolbar.fn.reallyBuildPage( context, id, page, $page );
- $page.removeClass( 'loading' );
- } );
- } else {
-
$.wikiEditor.modules.toolbar.fn.reallyBuildPage( context, id, page, $page );
- }
+ $.wikiEditor.modules.toolbar.fn.reallyBuildPage(
context, id, page, $page );
return $page;
},
reallyBuildPage: function ( context, id, page, $page ) {
@@ -667,7 +659,7 @@
var selected = $.cookie( 'wikiEditor-' +
context.instance + '-toolbar-section' );
var show = selected === id;
- $.wikiEditor.modules.toolbar.fn.reallyBuildSection(
context, id, section, $section, section.deferLoad );
+ $.wikiEditor.modules.toolbar.fn.reallyBuildSection(
context, id, section, $section );
// Show or hide section
if ( id !== 'main' ) {
@@ -681,7 +673,7 @@
}
return $section;
},
- reallyBuildSection: function ( context, id, section, $section,
deferLoad ) {
+ reallyBuildSection: function ( context, id, section, $section )
{
context.$textarea.trigger(
'wikiEditor-toolbar-buildSection-' + $section.attr( 'rel' ), [ section ] );
switch ( section.type ) {
case 'toolbar':
@@ -699,7 +691,7 @@
if ( 'pages' in section ) {
for ( var page in section.pages
) {
$pages.append(
-
$.wikiEditor.modules.toolbar.fn.buildPage( context, page, section.pages[ page
], deferLoad )
+
$.wikiEditor.modules.toolbar.fn.buildPage( context, page, section.pages[ page ]
)
);
$index.append(
$.wikiEditor.modules.toolbar.fn.buildBookmark( context, page, section.pages[
page ] )
diff --git a/modules/jquery.wikiEditor.toolbar.less
b/modules/jquery.wikiEditor.toolbar.less
index bee67c1..5e267dc 100644
--- a/modules/jquery.wikiEditor.toolbar.less
+++ b/modules/jquery.wikiEditor.toolbar.less
@@ -32,27 +32,6 @@
.section-hidden {
display: none;
}
-
- /* Gets overridden when the section div is in class loading -
see below */
- div {
- .spinner {
- display: none;
- }
- }
-
- .loading {
- .spinner {
- .background-image('images/toolbar/loading.gif');
- background-position: left center;
- background-repeat: no-repeat;
- color: #666;
- display: block;
- float: left;
- height: 32px;
- margin-left: 0.5em;
- padding-left: 32px;
- }
- }
}
/* Top Level Containers */
@@ -90,10 +69,6 @@
&:hover {
text-decoration: none;
}
- }
-
- a.loading {
-
.background-image('images/toolbar/loading-small.gif');
}
}
}
--
To view, visit https://gerrit.wikimedia.org/r/268968
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I49909ef35b87ce9091cf9897f278adcc420c14aa
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikiEditor
Gerrit-Branch: master
Gerrit-Owner: Gerrit Patch Uploader <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits