Commit 0e9c802d authored by yPhil's avatar yPhil

Menu Button bindings

parent 9a6bf9d4
......@@ -54,11 +54,25 @@ PTL.menu = {
PTL.sync.attachWidget();
$menuButton.click(function() {
$menuButton.on('click', function() {
console.log('CLIK!');
$overlay.toggleClass('visible');
$menu.toggleClass('expanded');
});
$newSourceButton.on('click', function() {
var $openGroupPanel = $($('.ui-tabs-active').find('a').attr('href')).find('.tabSort');
$overlay.removeClass('visible');
$menu.removeClass('expanded');
PTL.feed.make($openGroupPanel, 'New Feed', 'mixed', 8, true);
});
$helpButton.on('click', function(event) {
event.preventDefault();
$('#tabs').tabs('option', 'active', 0);
PTL.dialog.help();
});
$sourceCodeButton.click(function(event) {
event.preventDefault();
window.open('https://framagit.org/yphil/petrolette');
......@@ -66,25 +80,18 @@ PTL.menu = {
$overlay.click(function() {
$(this).removeClass('visible');
$menu.removeClass('expanded');
});
$menu.removeClass('expanded');
});
$newSourceButton.click(function() {
var $openGroupPanel = $($('.ui-tabs-active').find('a').attr('href')).find('.tabSort');
$overlay.removeClass('visible');
$menu.removeClass('expanded');
PTL.feed.make($openGroupPanel, 'New Feed', 'mixed', 8, true);
});
$(document).keydown(function(event) {
if (event.keyCode === $.ui.keyCode.ESCAPE) {
$('.tabSort' ).sortable('cancel');
}
});
$(document).keydown(function(event) {
if (event.keyCode === $.ui.keyCode.ESCAPE) {
$('.tabSort' ).sortable('cancel');
}
});
var $widget = $('#remotestorage-widget');
var $widget = $('#remotestorage-widget');
var $readMore = $('<a>')
var $readMore = $('<a>')
.attr('class', 'rs-help')
.attr('href', 'https:remotestorage.io/')
.text(PTL.tr('Read more.'));
......@@ -111,13 +118,6 @@ PTL.menu = {
PTL.utilities.translate();
});
$helpButton.click(function (event) {
event.preventDefault();
$('#tabs').tabs('option', 'active', 0);
// PTL.utilities.help('ui');
PTL.dialog.help();
});
$importButton.click(function () {
$("input#fileImport").click();
return false;
......
......@@ -85,11 +85,9 @@ PTL.tab = {
PTL.tab.saveTabs();
PTL.tab.makeNewTabButton($('div#tabs'));
},
populate:function(tabs, clickToRefresh, add) {
populate:function(sources, clickToRefresh, add) {
if (add) {
console.log('ADD!');
} else {
if (!add) {
$('div#tabs div').remove();
$('div#tabs ul li').remove();
PTL.tab.makeNewTabButton($('div#tabs'));
......@@ -98,13 +96,13 @@ PTL.tab = {
var totalFeeds = 0,
progress = PTL.utilities.buildProgress();
tabs.forEach(function(tab) {
sources.forEach(function(tab) {
totalFeeds += tab.feeds.length;
});
progress.init(totalFeeds);
tabs.forEach(function(tab) {
sources.forEach(function(tab) {
PTL.tab.make($('#tabs'), tab.name, tab.feeds, progress);
});
......@@ -162,8 +160,8 @@ PTL.tab = {
var $newTabButtonIcon = $('<a>')
.attr('class', 'plusButton icon-plus-1');
$newTabButtonLink.bind('click', function(e) {
e.stopImmediatePropagation();
$newTabButtonLink.bind('click', function(event) {
event.stopImmediatePropagation();
PTL.tab.make($($tabs));
......@@ -177,8 +175,6 @@ PTL.tab = {
},
make:function($tabs, name, feeds, progress) {
// $tabs.tabs();
$('#noSourcesButton').fadeOut('fast');
var tabIndex = $('ul#tabUl li.mobTab').length + 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment