Created
June 5, 2014 19:25
-
-
Save ffflabs/85b2543c219ff6e24d2a to your computer and use it in GitHub Desktop.
Toggle Visualization
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery('#datasets').on('click', '.toggle_visualizations', function () { | |
var thischeckbox = jQuery(this); | |
var ladata = thischeckbox.data(); | |
var id_dataset = ladata.id_dataset; | |
var category = ladata.category; | |
globalmap[category] = globalmap[category] || {}; | |
var DataSet = globalmap[category][id_dataset]; | |
ladata.flag = thischeckbox.is(':checked'); | |
DataSet.setOptions({ | |
visible: ladata.flag | |
}); | |
DataSet.saveSetting({ | |
visible: ladata.flag | |
}); | |
Intercom('trackEvent', 'updateVisibility', ladata); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment