add studio survey button to header.
adds JS to save in local storage whether the user already clicked the survey. The button appears only if they have not clicked it yet. Change-Id: Ifc5a100a8bb8505c47d95c7cfb5aaa8cdbfdc8bd
This commit is contained in:
@@ -21,6 +21,8 @@ $.ajaxSetup({
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
showStudioSurveyButton();
|
||||
|
||||
// show lang dialog if the URL includes /intl/
|
||||
//if (location.pathname.substring(0,6) == "/intl/") {
|
||||
// var lang = location.pathname.split('/')[2];
|
||||
@@ -5375,3 +5377,17 @@ function showSamples() {
|
||||
$(document)
|
||||
.on('click.toggle', '[data-toggle="section"]', Toggle.prototype.toggle);
|
||||
})(jQuery);
|
||||
|
||||
|
||||
var STUDIO_SURVEY_CLICKED = 'studio-survey-20160429-clicked';
|
||||
|
||||
function onClickStudioSurvey() {
|
||||
localStorage.setItem(STUDIO_SURVEY_CLICKED, 'true');
|
||||
$("#studio-survey-button").fadeOut();
|
||||
}
|
||||
|
||||
function showStudioSurveyButton() {
|
||||
if (localStorage.getItem(STUDIO_SURVEY_CLICKED) == null) {
|
||||
$("#studio-survey-button").show();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user