[MediaWiki-commits] [Gerrit] Enable routing on TalkSectionOverlay - change (mediawiki...MobileFrontend)

2014-11-10 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Enable routing on TalkSectionOverlay
..


Enable routing on TalkSectionOverlay

Bug: 71075
Change-Id: Ie5dd5b0e66cd192e32dc9288732d16ed49948eec
---
M javascripts/modules/talk/TalkOverlay.js
M javascripts/modules/talk/TalkSectionOverlay.js
M javascripts/modules/talk/talk.js
M templates/modules/talk/talk.hogan
4 files changed, 48 insertions(+), 71 deletions(-)

Approvals:
  Jhernandez: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/javascripts/modules/talk/TalkOverlay.js 
b/javascripts/modules/talk/TalkOverlay.js
index 4dbdb92..b70bef7 100644
--- a/javascripts/modules/talk/TalkOverlay.js
+++ b/javascripts/modules/talk/TalkOverlay.js
@@ -4,7 +4,6 @@
var
Overlay = M.require( 'Overlay' ),
Page = M.require( 'Page' ),
-   TalkSectionOverlay = M.require( 
'modules/talk/TalkSectionOverlay' ),
user = M.require( 'user' ),
/**
 * Overlay for talk page
@@ -46,9 +45,6 @@
this._loadContent( options );
}
this._setupAddDiscussionButton( options );
-   if ( this.page ) {
-   this._setupSectionLinks();
-   }
this._showHidden( '.initial-header' );
},
 
@@ -133,38 +129,6 @@
} else {
$add.remove();
}
-   },
-   /**
-* Setups the headings as links that when clicked open 
an overlay with the talk
-* page content.
-* FIXME: Make this a link in the template.
-* @method
-*/
-   _setupSectionLinks: function () {
-   var childOverlay, self = this,
-   page = this.page;
-
-   // FIXME: Use Router instead for this
-   this.$( '.page-list a' ).on( 'click', function 
() {
-   var id = parseFloat( $( this ).data( 
'id' ), 10 ),
-   section = page.getSubSection( 
id );
-
-   if ( section ) {
-   childOverlay = new 
TalkSectionOverlay( {
-   parent: self,
-   title: page.title,
-   section: section
-   } );
-   // Hide discussion list to 
disable scrolling - bug 70989
-   // FIXME: Kill when 
OverlayManager is used for TalkSections
-   self.$board.hide();
-   childOverlay.show();
-   }
-   // When closing this overlay, also 
close the child section overlay
-   self.on( 'hide', function () {
-   childOverlay.remove();
-   } );
-   } );
}
} );
 
diff --git a/javascripts/modules/talk/TalkSectionOverlay.js 
b/javascripts/modules/talk/TalkSectionOverlay.js
index dcdb18b..b0d550c 100644
--- a/javascripts/modules/talk/TalkSectionOverlay.js
+++ b/javascripts/modules/talk/TalkSectionOverlay.js
@@ -1,9 +1,10 @@
-( function ( M, $ ) {
+( function ( M ) {
var
Overlay = M.require( 'Overlay' ),
popup = M.require( 'toast' ),
api = M.require( 'api' ),
user = M.require( 'user' ),
+   Page = M.require( 'Page' ),
TalkSectionOverlay;
 
/**
@@ -17,40 +18,42 @@
content: mw.template.get( 'mobile.talk.overlays', 
'Section/content.hogan' )
},
defaults: {
+   title: undefined,
+   section: undefined,
reply: mw.msg( 'mobile-frontend-talk-reply' ),
confirmMsg: mw.msg( 'mobile-frontend-editor-save' ),
info: mw.msg( 'mobile-frontend-talk-reply-info' )
},
-   // FIXME: Use Router for TalkSectionOverlay
-   hide: function () {
-   if ( this.$board ) {
-  

[MediaWiki-commits] [Gerrit] Enable routing on TalkSectionOverlay - change (mediawiki...MobileFrontend)

2014-11-07 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/171981

Change subject: Enable routing on TalkSectionOverlay
..

Enable routing on TalkSectionOverlay

Bug: 71075
Change-Id: Ie5dd5b0e66cd192e32dc9288732d16ed49948eec
---
M javascripts/modules/talk/TalkOverlay.js
M javascripts/modules/talk/TalkSectionOverlay.js
M javascripts/modules/talk/talk.js
M templates/modules/talk/talk.hogan
4 files changed, 46 insertions(+), 69 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/81/171981/1

diff --git a/javascripts/modules/talk/TalkOverlay.js 
b/javascripts/modules/talk/TalkOverlay.js
index 4dbdb92..b70bef7 100644
--- a/javascripts/modules/talk/TalkOverlay.js
+++ b/javascripts/modules/talk/TalkOverlay.js
@@ -4,7 +4,6 @@
var
Overlay = M.require( 'Overlay' ),
Page = M.require( 'Page' ),
-   TalkSectionOverlay = M.require( 
'modules/talk/TalkSectionOverlay' ),
user = M.require( 'user' ),
/**
 * Overlay for talk page
@@ -46,9 +45,6 @@
this._loadContent( options );
}
this._setupAddDiscussionButton( options );
-   if ( this.page ) {
-   this._setupSectionLinks();
-   }
this._showHidden( '.initial-header' );
},
 
@@ -133,38 +129,6 @@
} else {
$add.remove();
}
-   },
-   /**
-* Setups the headings as links that when clicked open 
an overlay with the talk
-* page content.
-* FIXME: Make this a link in the template.
-* @method
-*/
-   _setupSectionLinks: function () {
-   var childOverlay, self = this,
-   page = this.page;
-
-   // FIXME: Use Router instead for this
-   this.$( '.page-list a' ).on( 'click', function 
() {
-   var id = parseFloat( $( this ).data( 
'id' ), 10 ),
-   section = page.getSubSection( 
id );
-
-   if ( section ) {
-   childOverlay = new 
TalkSectionOverlay( {
-   parent: self,
-   title: page.title,
-   section: section
-   } );
-   // Hide discussion list to 
disable scrolling - bug 70989
-   // FIXME: Kill when 
OverlayManager is used for TalkSections
-   self.$board.hide();
-   childOverlay.show();
-   }
-   // When closing this overlay, also 
close the child section overlay
-   self.on( 'hide', function () {
-   childOverlay.remove();
-   } );
-   } );
}
} );
 
diff --git a/javascripts/modules/talk/TalkSectionOverlay.js 
b/javascripts/modules/talk/TalkSectionOverlay.js
index dcdb18b..1ede88e 100644
--- a/javascripts/modules/talk/TalkSectionOverlay.js
+++ b/javascripts/modules/talk/TalkSectionOverlay.js
@@ -4,6 +4,7 @@
popup = M.require( 'toast' ),
api = M.require( 'api' ),
user = M.require( 'user' ),
+   Page = M.require( 'Page' ),
TalkSectionOverlay;
 
/**
@@ -17,40 +18,42 @@
content: mw.template.get( 'mobile.talk.overlays', 
'Section/content.hogan' )
},
defaults: {
+   title: undefined,
+   section: undefined,
reply: mw.msg( 'mobile-frontend-talk-reply' ),
confirmMsg: mw.msg( 'mobile-frontend-editor-save' ),
info: mw.msg( 'mobile-frontend-talk-reply-info' )
},
-   // FIXME: Use Router for TalkSectionOverlay
-   hide: function () {
-   if ( this.$board ) {
-   this.$board.show();
-