Menu icon Foundation
F5 - Opening Reveal Triggers Tab Change?

I've got a strange issue and it's causing me some hassle.

When this function below is triggered using just the quote_id as an argument, it switches the active tab in my application. The entire thing is based on ajax requests so there are no reloads, but having it switching between a 'Quotes' and 'Customers' tab for seemingly no reason is a bit annoying.

Anyone have any ideas?

If there is a way I can debug the tab change event somehow that'd be great.

And on a slightly unrelated note, when I go to edit post, edit the code and publish post, it doesn't seem to save my changes...

function openQuote(quote_id, callback) {
	quote_id = typeof quote_id !== 'undefined' ? quote_id : "";
	callback = typeof callback !== 'undefined' ? callback : function() {} ;

	if(!$('#reveal-quote').hasClass('open')) {
		$('#reveal-quote').foundation('reveal', 'open')
	}

	$('#reveal-quote .form-container').load('Foundation5/php/quotes/load/reveal-quotes.php?id=' + quote_id, function() {

		if(quote_id.length) {
			$('#reveal-quote h3 .title').text($('#quote-form-quotenumber').val());
		} else {
			$('#reveal-quote h3 .title').text("New Quote - " + $('#quote-form-quotenumber').val());
		}

		$('.quote-customer-data').load('Foundation5/php/quotes/load_snippets/quote-customer-data.php?id=' + quote_id);

		$('#reveal-quote').attr('data-id', quote_id).find('#tab-quoted-files').load('Foundation5/php/quotes/load/reveal-dropbox.php?id=' + quote_id, function() {
			callback();
		});
	});
}

revealmodaltabsfoundation5sites

I've got a strange issue and it's causing me some hassle.

When this function below is triggered using just the quote_id as an argument, it switches the active tab in my application. The entire thing is based on ajax requests so there are no reloads, but having it switching between a 'Quotes' and 'Customers' tab for seemingly no reason is a bit annoying.

Anyone have any ideas?

If there is a way I can debug the tab change event somehow that'd be great.

And on a slightly unrelated note, when I go to edit post, edit the code and publish post, it doesn't seem to save my changes...

function openQuote(quote_id, callback) {
	quote_id = typeof quote_id !== 'undefined' ? quote_id : "";
	callback = typeof callback !== 'undefined' ? callback : function() {} ;

	if(!$('#reveal-quote').hasClass('open')) {
		$('#reveal-quote').foundation('reveal', 'open')
	}

	$('#reveal-quote .form-container').load('Foundation5/php/quotes/load/reveal-quotes.php?id=' + quote_id, function() {

		if(quote_id.length) {
			$('#reveal-quote h3 .title').text($('#quote-form-quotenumber').val());
		} else {
			$('#reveal-quote h3 .title').text("New Quote - " + $('#quote-form-quotenumber').val());
		}

		$('.quote-customer-data').load('Foundation5/php/quotes/load_snippets/quote-customer-data.php?id=' + quote_id);

		$('#reveal-quote').attr('data-id', quote_id).find('#tab-quoted-files').load('Foundation5/php/quotes/load/reveal-dropbox.php?id=' + quote_id, function() {
			callback();
		});
	});
}
Bill Bell over 4 years ago

I don't know what environment you use to debug javascript but I find Visual Studio 2013 Express For Web to be excellent for debugging events in Javascript. Just use IE as the browser and it is easy to trace events. I suspect you may be triggering several events.