<commit_before>var navigation = Alloy.Globals.navigation;
var mainWindow = navigation.getMainWindow();

$.menuOpen = false;

exports.init = function() {
	mainWindow.add($.menuWrap);
};

exports.toggle = function() {
	exports.fireEvent("toggle");
	Ti.API.info("Toggling menu");
	
	if ($.menuOpen) {
		exports.close();
	}
	else {
		exports.open();
	}
};
	
exports.open = function() {
	if ( ! $.menuOpen) {
		Ti.API.info("Opening menu");
		$.menuOpen = true;
		exports.fireEvent("openstart");
		
		// Set the width of the menu
		var newMenuWidth = mainWindow.size.width - 70;
		$.menu.width = (newMenuWidth > $.menu.width) ? $.menu.width : newMenuWidth;	

		// Show menu
		navigation.appWrap.animate({left: $.menu.width, duration: 150, curve: Ti.UI.ANIMATION_CURVE_EASE_OUT}, function() {
			exports.fireEvent("opencompleted");
		});
	}
	else {<commit_msg>Removed exit button from menu on iOS since it doesn't work the same way as Android<commit_after>var navigation = Alloy.Globals.navigation;
var mainWindow = navigation.getMainWindow();

$.menuOpen = false;

exports.init = function() {
	mainWindow.add($.menuWrap);
	
	if (OS_IOS) {
		$.menu.remove($.buttonExit);
	}
};

exports.toggle = function() {
	exports.fireEvent("toggle");
	Ti.API.info("Toggling menu");
	
	if ($.menuOpen) {
		exports.close();
	}
	else {
		exports.open();
	}
};
	
exports.open = function() {
	if ( ! $.menuOpen) {
		Ti.API.info("Opening menu");
		$.menuOpen = true;
		exports.fireEvent("openstart");
		
		// Set the width of the menu
		var newMenuWidth = mainWindow.size.width - 70;
		$.menu.width = (newMenuWidth > $.menu.width) ? $.menu.width : newMenuWidth;	

		// Show menu
		navigation.appWrap.animate({left: $.menu.width, duration: 150, curve: Ti.UI.ANIMATION_CURVE_EASE_OUT}, function() {
			exports.fireEvent("opencompleted");
		});
	}
	else {
{'fraction_non_alphanumeric': 0.1692223439211391, 'fraction_numerical': 0.00547645125958379, 'mean_word_length': 3.859042553191489, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2194715', 'n_tokens_mistral': 690, 'n_tokens_neox': 627, 'n_words': 130}