betaflight-configurator/tabs/landing.js

48 lines
1.3 KiB
JavaScript
Raw Normal View History

'use strict';
TABS.landing = {};
TABS.landing.initialize = function (callback) {
var self = this;
if (GUI.active_tab != 'landing') {
GUI.active_tab = 'landing';
2014-10-30 11:33:39 +00:00
googleAnalytics.sendAppView('Landing');
}
2014-03-08 05:25:15 +00:00
$('#content').load("./tabs/landing.html", function () {
2014-05-06 14:45:26 +00:00
// translate to user-selected language
localize();
// load changelog content
2015-11-11 12:21:35 +00:00
$('#changelog .log').load('./changelog.html');
2014-03-08 05:25:15 +00:00
2014-08-12 14:05:22 +00:00
$('div.welcome a, div.sponsors a').click(function () {
2014-07-16 10:59:12 +00:00
googleAnalytics.sendEvent('ExternalUrls', 'Click', $(this).prop('href'));
});
2015-11-07 05:16:02 +00:00
2015-11-11 12:21:35 +00:00
/** changelog trigger **/
$("#changelog_toggle").on('click', function() {
var state = $(this).data('state2');
if (state) {
$("#changelog").animate({right: -245}, 200, function () {
$("#content").removeClass('log_open');
});
state = false;
} else {
$("#changelog").animate({right: 0}, 200);
$("#content").addClass('log_open');
state = true;
}
$(this).text(state ? 'Close' : 'Changelog');
$(this).data('state2', state);
});
2014-07-10 16:14:17 +00:00
GUI.content_ready(callback);
});
2015-11-11 12:21:35 +00:00
2014-07-10 16:14:17 +00:00
};
TABS.landing.cleanup = function (callback) {
2014-07-10 16:14:17 +00:00
if (callback) callback();
2015-11-11 12:21:35 +00:00
};