initial import
This commit is contained in:
parent
09ca392d36
commit
6cb3690e37
304 changed files with 36492 additions and 0 deletions
26
sass/styleguide-builder/kss-assets/kss-guides.js
Normal file
26
sass/styleguide-builder/kss-assets/kss-guides.js
Normal file
|
@ -0,0 +1,26 @@
|
|||
(function (window, document) {
|
||||
'use strict';
|
||||
|
||||
var KssGuides = function (config) {
|
||||
this.bodyClass = config.bodyClass || 'kss-guides-mode';
|
||||
|
||||
this.init();
|
||||
};
|
||||
|
||||
KssGuides.prototype.init = function () {
|
||||
var self = this;
|
||||
// Initialize all guides toggle buttons.
|
||||
document.querySelectorAll('a[data-kss-guides]').forEach(function (el) {
|
||||
el.onclick = self.showGuides.bind(self);
|
||||
});
|
||||
};
|
||||
|
||||
// Toggle the guides mode.
|
||||
KssGuides.prototype.showGuides = function () {
|
||||
document.getElementsByTagName('body')[0].classList.toggle(this.bodyClass);
|
||||
};
|
||||
|
||||
// Export to DOM global space.
|
||||
window.KssGuides = KssGuides;
|
||||
|
||||
})(window, document);
|
Loading…
Add table
Add a link
Reference in a new issue