diff --git a/www/common/common-interface.js b/www/common/common-interface.js index 72438fec2..8efc7397a 100644 --- a/www/common/common-interface.js +++ b/www/common/common-interface.js @@ -187,7 +187,8 @@ define([ dialog.tabs = function (tabs) { var contents = []; var titles = []; - tabs.forEach(function (tab) { + var active = 0; + tabs.forEach(function (tab, i) { if (!tab.content || !tab.title) { return; } var content = h('div.alertify-tabs-content', tab.content); var title = h('span.alertify-tabs-title', tab.title); @@ -203,10 +204,11 @@ define([ }); titles.push(title); contents.push(content); + if (tab.active) { active = i; } }); if (contents.length) { - $(contents[0]).addClass('alertify-tabs-content-active'); - $(titles[0]).addClass('alertify-tabs-active'); + $(contents[active]).addClass('alertify-tabs-content-active'); + $(titles[active]).addClass('alertify-tabs-active'); } return h('div.alertify-tabs', [ h('div.alertify-tabs-titles', titles), diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index f7c84298a..b8ae705a2 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -1185,13 +1185,15 @@ define([ // Create modal var tabs = [{ - title: Messages.share_linkCategory, - icon: "fa fa-link", - content: frameLink - }, { title: Messages.share_contactCategory, icon: "fa fa-address-book", - content: frameContacts + content: frameContacts, + active: hasFriends + }, { + title: Messages.share_linkCategory, + icon: "fa fa-link", + content: frameLink, + active: !hasFriends }, { title: Messages.share_embedCategory, icon: "fa fa-code",