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

Bug: T145267
Change-Id: Ie88c4d9c6327baffdb83c1affbc0515a68c0fc03
This commit is contained in:
Alex Monk 2016-09-14 01:19:39 +01:00
parent 2fb10700b3
commit 0c07caafc7
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

@ -1176,7 +1176,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' );
@ -1193,8 +1194,16 @@ ve.init.mw.DesktopArticleTarget.prototype.transformPage = function () {
$content.nextAll().addClass( 've-init-mw-desktopArticleTarget-uneditableContent' );
$content = $content.parent();
}
// Support IE9: Disable links
$( '.ve-init-mw-desktopArticleTarget-uneditableContent' ).on( 'click.ve-target', function () { return false; } );
$( '.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
return false;
} );
this.updateHistoryState();
};