Skip to content

Instantly share code, notes, and snippets.

@adamsilver
Created June 9, 2015 09:03
Show Gist options
  • Save adamsilver/3be77a93358d79231843 to your computer and use it in GitHub Desktop.
Save adamsilver/3be77a93358d79231843 to your computer and use it in GitHub Desktop.
anon.js inside ily
'use strict';
var Delegate = require('dom-delegate');
function getNotificationHtml(message) {
return message;
}
module.exports = {
init: function () {
return;
var delegate = new Delegate(document.querySelector('.mypage__onboarding'));
var notificationContainer = document.querySelector('.notification-container');
var notificationDelegate = new Delegate(notificationContainer);
notificationDelegate.on('click', '.notification-item__hide-button', function(e, el) {
notificationContainer.style.display = "none";
});
delegate.on('click', '.myft-ui--follow .myft-ui__button', function (ev, el) {
ev.preventDefault();
var messageContainer = notificationContainer.querySelector('p');
messageContainer.innerHTML = getNotificationHtml('Please subscribe or sign in to follow this topic.');
notificationContainer.style.display = "block";
});
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment