betaflight-configurator/tabs/landing.js

54 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-07 05:16:02 +00:00
$('div.changelog.configurator .changewrapper').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
/** changelog trigger **/
$("#changelog_button").on('click', function() {
var state = $(this).data('state2');
if ( state ) {
$(".changelog").animate({width: 0}, 200);
$(".changewrapper").animate({opacity: 0}, 500);
$(".changewrapper").removeClass('active');
state = false;
}else{
$(".changelog").animate({width: 220}, 200);
$(".changewrapper").animate({opacity: 1}, 500);
$(".changewrapper").addClass('active');
state = true;
}
$(this).text(state ? 'Close' : 'Changelog');
$(this).data('state2', state);
});
2014-07-10 16:14:17 +00:00
if (callback) callback();
});
2014-07-10 16:14:17 +00:00
};
TABS.landing.cleanup = function (callback) {
2014-07-10 16:14:17 +00:00
if (callback) callback();
};