Merge "Open meta dialog to edit categories when user clicks on the category footer"

This commit is contained in:
jenkins-bot 2016-09-20 00:58:29 +00:00 committed by Gerrit Code Review
commit f6b7c64e92
2 changed files with 22 additions and 7 deletions

View file

@ -40,13 +40,12 @@
overflow: hidden;
}
/* Once activated, everything except the progress bar, the edit target, and the category footer */
.ve-activated .ve-init-mw-desktopArticleTarget-uneditableContent :not([id='catlinks']),
/* While loading, everything except the progress bar */
.ve-loading #content > :not( .ve-init-mw-desktopArticleTarget-loading-overlay ),
/* Once activated, everything except the progress bar and the edit target */
.ve-activated .ve-init-mw-desktopArticleTarget-uneditableContent {
.ve-loading #content > :not( .ve-init-mw-desktopArticleTarget-loading-overlay ) {
/* IE9 is supported with JS events */
/* stylelint-disable no-unsupported-browser-features */
opacity: 0.5;
pointer-events: none;
-webkit-user-select: none;
-moz-user-select: none;
@ -55,6 +54,13 @@
/* stylelint-enable no-unsupported-browser-features */
}
/* While loading, everything except the progress bar */
.ve-loading #content > :not( .ve-init-mw-desktopArticleTarget-loading-overlay ),
/* Once activated, everything except the progress bar and the edit target */
.ve-activated .ve-init-mw-desktopArticleTarget-uneditableContent {
opacity: 0.5;
}
/* Progress bar mimicking OOUI */
.ve-activated #content {

View file

@ -1177,7 +1177,8 @@ ve.init.mw.DesktopArticleTarget.prototype.restoreDocumentTitle = function () {
* Page modifications for switching to edit mode.
*/
ve.init.mw.DesktopArticleTarget.prototype.transformPage = function () {
var $content;
var target = this,
$content;
this.updateTabs( true );
this.emit( 'transformPage' );
@ -1194,8 +1195,16 @@ ve.init.mw.DesktopArticleTarget.prototype.transformPage = function () {
$content.nextAll().addClass( 've-init-mw-desktopArticleTarget-uneditableContent' );
$content = $content.parent();
}
$( '.ve-init-mw-desktopArticleTarget-uneditableContent' ).on( 'click.ve-target', function () {
var windowAction;
if ( $( this ).attr( 'id' ) === 'catlinks' ) {
windowAction = ve.ui.actionFactory.create( 'window', target.getSurface() );
windowAction.open( 'meta', { page: 'categories' } );
return false;
}
// Support IE9: Disable links
$( '.ve-init-mw-desktopArticleTarget-uneditableContent' ).on( 'click.ve-target', function () { return false; } );
return false;
} );
this.updateHistoryState();
};