'use strict'; /* Define a entry sheet. * It creates a element provided by container, title, content. */ /* jshint ignore:start */ window.EntrySheet = (function invocation() { function EntrySheet() { // This constructor function is a local variable. render.apply(this, arguments); // All arguments are values to render } EntrySheet.className = 'entrySheet'; EntrySheet.prototype.setTitle = function(title) { this.titleElement.textContent = title; }; EntrySheet.prototype.open = function() { // Transtion won't happen if adding class directly setTimeout(function() { this.element.classList.add('active'); }.bind(this)); }; EntrySheet.prototype.close = function() { this.element.addEventListener('transitionend', function onTransitionend() { this.element.removeEventListener('transitionend', onTransitionend); this.element.classList.remove('disappearing'); this.element.classList.remove('active'); // Here we remove entire element once the close button is pressed. this.container.removeChild(this.element); if (this.onCloseCallback) { this.onCloseCallback(); } }.bind(this)); this.element.classList.add('disappearing'); }; // These are helper functions and variables used by the methods above // They're not part of the public API of the module, but they're hidden // within this function scope so we don't have to define them as a // property of Browser or prefix them with underscores. // Now define instance methods on Set.prototype. function view() { return '