jenkins-bot has submitted this change and it was merged.
Change subject: Improve Talk Overlay
......................................................................
Improve Talk Overlay
* Fix "close TalkOverlay when TalkSectionOverlay is closed" by call .show()
after TalkSectionOverlay or TalkSectionAddOverlay is closed.
* Added header to TalkSectionOverlay and TalkSectionAddOverlay to show
back instead of close button.
* Show Title of Talk as Title (of Overlay) in TalkSectionOverlay instead of
a seperate line.
* Use named button in TalkSectionAddOverlay (like Editor) instead of image.
* Cursor for links in talk overlay should be a pointer.
* Fixed "Uncaught TypeError: Cannot read property 'hide' of undefined" after
adding a new discussion by remove the try to hide talkOverlay. Main problem
addressed
in change I2a31a8b704adc2401e1b2c030cfe54a0eb7c771e
Bug: 64105
Change-Id: If76138eaa015607241bad2ec773d48cf2daf650a
---
M includes/Resources.php
M javascripts/modules/talk/TalkOverlay.js
M javascripts/modules/talk/TalkSectionAddOverlay.js
M javascripts/modules/talk/TalkSectionOverlay.js
M less/modules/talk.less
R templates/modules/talk/talk.hogan
R templates/modules/talk/talkSection.hogan
R templates/modules/talk/talkSectionAdd.hogan
A templates/modules/talk/talkSectionAddHeader.hogan
A templates/modules/talk/talkSectionHeader.hogan
10 files changed, 53 insertions(+), 16 deletions(-)
Approvals:
Jdlrobson: Looks good to me, approved
jenkins-bot: Verified
diff --git a/includes/Resources.php b/includes/Resources.php
index 84c62c0..a6f9931 100644
--- a/includes/Resources.php
+++ b/includes/Resources.php
@@ -498,9 +498,11 @@
),
'templates' => array(
// talk.js
- 'overlays/talk.hogan',
- 'overlays/talkSectionAdd.hogan',
- 'talkSection.hogan',
+ 'modules/talk/talk.hogan',
+ 'modules/talk/talkSectionAdd.hogan',
+ 'modules/talk/talkSectionAddHeader.hogan',
+ 'modules/talk/talkSection.hogan',
+ 'modules/talk/talkSectionHeader.hogan',
),
'messages' => array(
'mobile-frontend-talk-explained',
diff --git a/javascripts/modules/talk/TalkOverlay.js
b/javascripts/modules/talk/TalkOverlay.js
index ad7ecb6..77772ec 100644
--- a/javascripts/modules/talk/TalkOverlay.js
+++ b/javascripts/modules/talk/TalkOverlay.js
@@ -10,7 +10,7 @@
user = M.require( 'user' ),
TalkOverlay = Overlay.extend( {
templatePartials: {
- content: M.template.get( 'overlays/talk.hogan' )
+ content: M.template.get(
'modules/talk/talk.hogan' )
},
defaults: {
addTopicLabel: mw.msg(
'mobile-frontend-talk-add-overlay-submit' ),
@@ -57,7 +57,7 @@
},
postRender: function( options ) {
var $add = this.$( 'button.add' ),
- page = options.page;
+ page = options.page, self = this;
this._super( options );
if ( !user.isAnon() ) {
@@ -66,6 +66,11 @@
title: options.title
} );
overlay.show();
+ overlay.on( 'hide', function() {
+ // re-enable
TalkOverlay (it's closed by hide event (in Overlay)
+ // from
TalkSectionAddOverlay)
+ self.show();
+ } );
} );
} else {
$add.remove();
@@ -84,6 +89,10 @@
section: section
} );
childOverlay.show();
+ childOverlay.on( 'hide', function() {
+ // re-enable TalkOverlay (it's
closed by hide event (in Overlay) from TalkSectionOverlay)
+ self.show();
+ } );
} );
if ( !$.trim( page.lead ) ) {
this.$( '.lead-discussion' ).remove();
diff --git a/javascripts/modules/talk/TalkSectionAddOverlay.js
b/javascripts/modules/talk/TalkSectionAddOverlay.js
index f4b793c..aabdeec 100644
--- a/javascripts/modules/talk/TalkSectionAddOverlay.js
+++ b/javascripts/modules/talk/TalkSectionAddOverlay.js
@@ -8,17 +8,15 @@
TalkSectionAddOverlay = Overlay.extend( {
defaults: {
- headerButtons: [
- { className: 'submit icon icon-submit
confirm-save', msg: mw.msg( 'mobile-frontend-editor-continue' ) }
- ],
cancelMsg: mw.msg( 'mobile-frontend-editor-cancel' ),
confirmMsg: mw.msg( 'mobile-frontend-editor-save' ),
- heading: '<strong>' + mw.msg(
'mobile-frontend-talk-add-overlay-submit' ) + '</strong>',
topicTitlePlaceHolder: mw.msg(
'mobile-frontend-talk-add-overlay-subject-placeholder' ),
- topicContentPlaceHolder: mw.msg(
'mobile-frontend-talk-add-overlay-content-placeholder' )
+ topicContentPlaceHolder: mw.msg(
'mobile-frontend-talk-add-overlay-content-placeholder' ),
+ editingMsg: mw.msg(
'mobile-frontend-talk-add-overlay-submit' )
},
+ template: M.template.get( 'modules/talk/talkSectionAdd.hogan' ),
templatePartials: {
- content: M.template.get(
'overlays/talkSectionAdd.hogan' )
+ header: M.template.get(
'modules/talk/talkSectionAddHeader.hogan' )
},
initialize: function( options ) {
// If terms of use is enabled, include it in the
licensing message
@@ -41,6 +39,7 @@
postRender: function( options ) {
var self = this;
this._super( options );
+ this.$( '.back' ).on( M.tapEvent( 'click' ), $.proxy(
self, 'hide' ) );
this.confirm = this.$( 'button.confirm-save' );
this.confirm.on( 'click', function() {
if ( !$( this ).prop( 'disabled' ) ) {
@@ -71,8 +70,6 @@
text: text + ' ~~~~'
} ).done( function() {
self.hide();
- // close the list of topics
overlay as well
- self.parent.hide();
M.pageApi.invalidatePage(
self.title );
toast.show( mw.msg(
'mobile-frontend-talk-topic-feedback' ), 'toast' );
} );
diff --git a/javascripts/modules/talk/TalkSectionOverlay.js
b/javascripts/modules/talk/TalkSectionOverlay.js
index b68c0e6..a4fafb1 100644
--- a/javascripts/modules/talk/TalkSectionOverlay.js
+++ b/javascripts/modules/talk/TalkSectionOverlay.js
@@ -5,8 +5,9 @@
api = M.require( 'api' ),
user = M.require( 'user' ),
TalkSectionOverlay = Overlay.extend( {
+ template: M.template.get( 'modules/talk/talkSection.hogan' ),
templatePartials: {
- content: M.template.get( 'talkSection.hogan' )
+ header: M.template.get(
'modules/talk/talkSectionHeader.hogan' ),
},
defaults: {
reply: mw.msg( 'mobile-frontend-talk-reply' ),
@@ -33,6 +34,7 @@
var self = this, $comment = this.$( '.comment' ),
$textarea = $comment.find( 'textarea' );
this._super( options );
+ this.$( '.back' ).on( M.tapEvent( 'click' ), $.proxy(
self, 'hide' ) );
this.$( '.loading' ).remove();
if ( user.isAnon() || !M.isAlphaGroupMember() ) {
$comment.remove();
diff --git a/less/modules/talk.less b/less/modules/talk.less
index 4280919..b3ad835 100644
--- a/less/modules/talk.less
+++ b/less/modules/talk.less
@@ -37,6 +37,10 @@
max-width: 10em;
}
}
+
+ a {
+ cursor: pointer;
+ }
}
.content-header {
diff --git a/templates/overlays/talk.hogan b/templates/modules/talk/talk.hogan
similarity index 100%
rename from templates/overlays/talk.hogan
rename to templates/modules/talk/talk.hogan
diff --git a/templates/talkSection.hogan
b/templates/modules/talk/talkSection.hogan
similarity index 84%
rename from templates/talkSection.hogan
rename to templates/modules/talk/talkSection.hogan
index 98ecad3..0c2f7b5 100644
--- a/templates/talkSection.hogan
+++ b/templates/modules/talk/talkSection.hogan
@@ -1,6 +1,8 @@
-<div class="content talk-section">
- <h2>{{section.line}}</h2>
+<div class="overlay-header-container position-fixed">
+ {{>header}}
+</div>
+<div class="content talk-section">
{{{section.text}}}
<div class="loading"></div>
<div class="comment">
diff --git a/templates/overlays/talkSectionAdd.hogan
b/templates/modules/talk/talkSectionAdd.hogan
similarity index 79%
rename from templates/overlays/talkSectionAdd.hogan
rename to templates/modules/talk/talkSectionAdd.hogan
index dbaaad9..c8c9727 100644
--- a/templates/overlays/talkSectionAdd.hogan
+++ b/templates/modules/talk/talkSectionAdd.hogan
@@ -1,3 +1,7 @@
+<div class="overlay-header-container position-fixed">
+ {{>header}}
+</div>
+
<div class="save-panel panel">
<p class="license">{{{licenseMsg}}}</p>
</div>
diff --git a/templates/modules/talk/talkSectionAddHeader.hogan
b/templates/modules/talk/talkSectionAddHeader.hogan
new file mode 100644
index 0000000..5dcafe9
--- /dev/null
+++ b/templates/modules/talk/talkSectionAddHeader.hogan
@@ -0,0 +1,9 @@
+<div class="overlay-header initial-header hideable">
+ <ul>
+ <li><button class="back icon
icon-back">{{closeMsg}}</button></li>
+ </ul>
+ <div class="overlay-title">
+ <h2>{{editingMsg}}</h2>
+ </div>
+ <div class="overlay-action"><button class="submit
confirm-save">{{confirmMsg}}</button></div>
+</div>
diff --git a/templates/modules/talk/talkSectionHeader.hogan
b/templates/modules/talk/talkSectionHeader.hogan
new file mode 100644
index 0000000..b048225
--- /dev/null
+++ b/templates/modules/talk/talkSectionHeader.hogan
@@ -0,0 +1,8 @@
+<div class="overlay-header initial-header hideable">
+ <ul>
+ <li><button class="back icon
icon-back">{{closeMsg}}</button></li>
+ </ul>
+ <div class="overlay-title">
+ <h2><span>{{section.line}}</span></h2>
+ </div>
+</div>
--
To view, visit https://gerrit.wikimedia.org/r/153341
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: If76138eaa015607241bad2ec773d48cf2daf650a
Gerrit-PatchSet: 8
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Florianschmidtwelzow <[email protected]>
Gerrit-Reviewer: Awjrichards <[email protected]>
Gerrit-Reviewer: Florianschmidtwelzow <[email protected]>
Gerrit-Reviewer: JGonera <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: Kaldari <[email protected]>
Gerrit-Reviewer: MaxSem <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits