Merge lp:~dpm/help-app/phone-navigation-update-1st-tab-title into lp:~ubuntu-touch-coreapps-drivers/help-app/trunk

Proposed by David Planella
Status: Merged
Merged at revision: 108
Proposed branch: lp:~dpm/help-app/phone-navigation-update-1st-tab-title
Merge into: lp:~ubuntu-touch-coreapps-drivers/help-app/trunk
Diff against target: 43 lines (+13/-8)
1 file modified
edit-here/index.html (+13/-8)
To merge this branch: bzr merge lp:~dpm/help-app/phone-navigation-update-1st-tab-title
Reviewer Review Type Date Requested Status
Daniel Holbach (community) Approve
Review via email: mp+253353@code.launchpad.net

Description of the change

Fixes the title of the first tab not being updated upon app launch. Again, thanks daker for the fix!

To post a comment you must log in.
Revision history for this message
Daniel Holbach (dholbach) wrote :

Great work, thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'edit-here/index.html'
2--- edit-here/index.html 2015-03-18 08:11:00 +0000
3+++ edit-here/index.html 2015-03-18 12:56:18 +0000
4@@ -99,19 +99,23 @@
5
6 // Dynamically load the content from individual FAQ pages
7 // to each tab
8- $("li[data-page]").each(function(){
9- var tabId = $(this).data('page');
10-
11- var that = $(this);
12+ $("li[data-page]").each(function(i){
13+ var tabId = $(this).data('page'),
14+ that = $(this),
15+ tabText,
16+ tabHTML,
17+ tabTitle,
18+ tabTextNoHeader;
19
20 $.get(tabId + "." + language + ".html", function (response) {
21 // This is asynchronous, so make sure
22 // any operations with tab content are done within
23 // this function.
24- var tabText = response;
25- var tabHTML = $.parseHTML(tabText);
26- var tabTitle = $('<div/>').append(tabHTML).find('h1').text();
27- var tabTextNoHeader = $(tabText).not('h1');
28+ tabText = response;
29+ tabHTML = $.parseHTML(tabText);
30+ tabTitle = $('<div/>').append(tabHTML).find('h1').text();
31+ tabTextNoHeader = $(tabText).not('h1');
32+ if (i == 0) $('[data-role="tabtitle"]').html(tabTitle);
33
34 // Populate the tab titles
35 that.html(tabTitle);
36@@ -119,6 +123,7 @@
37 // Populate the tab pages
38 $("#" + tabId).html(tabTextNoHeader);
39
40+ // $('a').attr('target', '_blank');
41 });
42 });
43 };

Subscribers

People subscribed via source and target branches