Skip to content

Commit

Permalink
Rebuild the dist and docs JS
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Erbe committed Dec 3, 2017
1 parent 389874b commit b9d613c
Show file tree
Hide file tree
Showing 11 changed files with 87 additions and 45 deletions.
70 changes: 55 additions & 15 deletions dist/bulma.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ var Bulma = {
* Current BulmaJS version.
* @type {String}
*/
VERSION: '0.2.0',
VERSION: '0.2.1',

/**
* Helper method to create a new plugin.
Expand Down Expand Up @@ -109,7 +109,7 @@ var Bulma = {
var plugin = element.getAttribute('data-bulma');

if (!Bulma.hasOwnProperty(plugin)) {
return console.warn('[BulmaJS] Plugin with the key \'' + plugin + '\' has not been registered.');
throw new Error('[BulmaJS] Plugin with the key \'' + plugin + '\' has not been registered.');
}

if (Bulma[plugin].hasOwnProperty('handleDomParsing')) {
Expand All @@ -119,7 +119,7 @@ var Bulma = {
}
};

document.addEventListener('DOMContentLoaded', function (event) {
document.addEventListener('DOMContentLoaded', function () {
Bulma.traverseDOM();
});

Expand Down Expand Up @@ -211,14 +211,6 @@ var DismissableComponent = function () {
this.insertBody();
}

if (this.isDismissable) {
if (!options.hasOwnProperty('closeButton')) {
this.prependCloseButton();
}

this.setupCloseEvent();
}

if (this.color) {
this.setColor();
}
Expand Down Expand Up @@ -405,7 +397,19 @@ var Notification = function (_DismissableComponent) {

if (!options) options = {};

return _possibleConstructorReturn(this, (Notification.__proto__ || Object.getPrototypeOf(Notification)).call(this, 'notification', options));
// TODO: Move this into the DismissableComponent class. Due to the required
// changes between different components, we may need a way to trigger this
// when the component is ready.
var _this = _possibleConstructorReturn(this, (Notification.__proto__ || Object.getPrototypeOf(Notification)).call(this, 'notification', options));

if (_this.isDismissable) {
if (!options.hasOwnProperty('closeButton')) {
_this.prependCloseButton();
}

_this.setupCloseEvent();
}
return _this;
}

/**
Expand Down Expand Up @@ -526,7 +530,7 @@ var Navbar = function () {

}, {
key: 'handleTriggerClick',
value: function handleTriggerClick(event) {
value: function handleTriggerClick() {
if (this.target.classList.contains('is-active')) {
this.target.classList.remove('is-active');
} else {
Expand Down Expand Up @@ -616,6 +620,17 @@ var Message = function (_DismissableComponent) {
_this.createMessageHeader();
}

// TODO: Move this into the DismissableComponent class. Due to the required
// changes between different components, we may need a way to trigger this
// when the component is ready.
if (_this.isDismissable) {
if (!options.hasOwnProperty('closeButton')) {
_this.prependCloseButton();
}

_this.setupCloseEvent();
}

if (_this.size) {
_this.setSize();
}
Expand Down Expand Up @@ -657,10 +672,35 @@ var Message = function (_DismissableComponent) {
this.root.classList.add('is-' + this.size);
}

/**
* Insert the body text into the component.
*/

}, {
key: 'insertBody',
value: function insertBody() {
var body = document.createElement('div');
body.classList.add('message-body');
body.innerHTML = this.body;

this.root.appendChild(body);
}

/**
* Handle parsing the DOMs data attribute API.
*/

}, {
key: 'prependCloseButton',


/**
* Insert the close button before our content.
*/
value: function prependCloseButton() {
console.log(this.title);
this.title.appendChild(this.closeButton);
}
}], [{
key: 'create',
value: function create(options) {
Expand Down Expand Up @@ -761,7 +801,7 @@ var Dropdown = function () {

}, {
key: 'handleTriggerClick',
value: function handleTriggerClick(event) {
value: function handleTriggerClick() {
if (this.root.classList.contains('is-active')) {
this.root.classList.remove('is-active');
} else {
Expand Down Expand Up @@ -928,7 +968,7 @@ var Modal = function () {
}
}, {
key: 'handleDomParsing',
value: function handleDomParsing(element) {
value: function handleDomParsing() {
return;
}
}]);
Expand Down
8 changes: 4 additions & 4 deletions dist/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ var Bulma = {
* Current BulmaJS version.
* @type {String}
*/
VERSION: '0.2.0',
VERSION: '0.2.1',

/**
* Helper method to create a new plugin.
Expand Down Expand Up @@ -110,7 +110,7 @@ var Bulma = {
var plugin = element.getAttribute('data-bulma');

if (!Bulma.hasOwnProperty(plugin)) {
return console.warn('[BulmaJS] Plugin with the key \'' + plugin + '\' has not been registered.');
throw new Error('[BulmaJS] Plugin with the key \'' + plugin + '\' has not been registered.');
}

if (Bulma[plugin].hasOwnProperty('handleDomParsing')) {
Expand All @@ -120,7 +120,7 @@ var Bulma = {
}
};

document.addEventListener('DOMContentLoaded', function (event) {
document.addEventListener('DOMContentLoaded', function () {
Bulma.traverseDOM();
});

Expand Down Expand Up @@ -200,7 +200,7 @@ var Dropdown = function () {

}, {
key: 'handleTriggerClick',
value: function handleTriggerClick(event) {
value: function handleTriggerClick() {
if (this.root.classList.contains('is-active')) {
this.root.classList.remove('is-active');
} else {
Expand Down
6 changes: 3 additions & 3 deletions dist/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ var Bulma = {
* Current BulmaJS version.
* @type {String}
*/
VERSION: '0.2.0',
VERSION: '0.2.1',

/**
* Helper method to create a new plugin.
Expand Down Expand Up @@ -110,7 +110,7 @@ var Bulma = {
var plugin = element.getAttribute('data-bulma');

if (!Bulma.hasOwnProperty(plugin)) {
return console.warn('[BulmaJS] Plugin with the key \'' + plugin + '\' has not been registered.');
throw new Error('[BulmaJS] Plugin with the key \'' + plugin + '\' has not been registered.');
}

if (Bulma[plugin].hasOwnProperty('handleDomParsing')) {
Expand All @@ -120,7 +120,7 @@ var Bulma = {
}
};

document.addEventListener('DOMContentLoaded', function (event) {
document.addEventListener('DOMContentLoaded', function () {
Bulma.traverseDOM();
});

Expand Down
8 changes: 4 additions & 4 deletions dist/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ var Bulma = {
* Current BulmaJS version.
* @type {String}
*/
VERSION: '0.2.0',
VERSION: '0.2.1',

/**
* Helper method to create a new plugin.
Expand Down Expand Up @@ -110,7 +110,7 @@ var Bulma = {
var plugin = element.getAttribute('data-bulma');

if (!Bulma.hasOwnProperty(plugin)) {
return console.warn('[BulmaJS] Plugin with the key \'' + plugin + '\' has not been registered.');
throw new Error('[BulmaJS] Plugin with the key \'' + plugin + '\' has not been registered.');
}

if (Bulma[plugin].hasOwnProperty('handleDomParsing')) {
Expand All @@ -120,7 +120,7 @@ var Bulma = {
}
};

document.addEventListener('DOMContentLoaded', function (event) {
document.addEventListener('DOMContentLoaded', function () {
Bulma.traverseDOM();
});

Expand Down Expand Up @@ -271,7 +271,7 @@ var Modal = function () {
}
}, {
key: 'handleDomParsing',
value: function handleDomParsing(element) {
value: function handleDomParsing() {
return;
}
}]);
Expand Down
8 changes: 4 additions & 4 deletions dist/navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ var Bulma = {
* Current BulmaJS version.
* @type {String}
*/
VERSION: '0.2.0',
VERSION: '0.2.1',

/**
* Helper method to create a new plugin.
Expand Down Expand Up @@ -110,7 +110,7 @@ var Bulma = {
var plugin = element.getAttribute('data-bulma');

if (!Bulma.hasOwnProperty(plugin)) {
return console.warn('[BulmaJS] Plugin with the key \'' + plugin + '\' has not been registered.');
throw new Error('[BulmaJS] Plugin with the key \'' + plugin + '\' has not been registered.');
}

if (Bulma[plugin].hasOwnProperty('handleDomParsing')) {
Expand All @@ -120,7 +120,7 @@ var Bulma = {
}
};

document.addEventListener('DOMContentLoaded', function (event) {
document.addEventListener('DOMContentLoaded', function () {
Bulma.traverseDOM();
});

Expand Down Expand Up @@ -206,7 +206,7 @@ var Navbar = function () {

}, {
key: 'handleTriggerClick',
value: function handleTriggerClick(event) {
value: function handleTriggerClick() {
if (this.target.classList.contains('is-active')) {
this.target.classList.remove('is-active');
} else {
Expand Down
1 change: 1 addition & 0 deletions docs/_includes/code/message/dismissable.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Bulma.create('message', {
title: "Manual dismiss only",
body: 'I am always visible until you close me manually.',
parent: document.getElementById('dismissable-message'),
isDismissable: true
Expand Down
8 changes: 4 additions & 4 deletions docs/assets/js/bulmajs/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ var Bulma = {
* Current BulmaJS version.
* @type {String}
*/
VERSION: '0.2.0',
VERSION: '0.2.1',

/**
* Helper method to create a new plugin.
Expand Down Expand Up @@ -110,7 +110,7 @@ var Bulma = {
var plugin = element.getAttribute('data-bulma');

if (!Bulma.hasOwnProperty(plugin)) {
return console.warn('[BulmaJS] Plugin with the key \'' + plugin + '\' has not been registered.');
throw new Error('[BulmaJS] Plugin with the key \'' + plugin + '\' has not been registered.');
}

if (Bulma[plugin].hasOwnProperty('handleDomParsing')) {
Expand All @@ -120,7 +120,7 @@ var Bulma = {
}
};

document.addEventListener('DOMContentLoaded', function (event) {
document.addEventListener('DOMContentLoaded', function () {
Bulma.traverseDOM();
});

Expand Down Expand Up @@ -200,7 +200,7 @@ var Dropdown = function () {

}, {
key: 'handleTriggerClick',
value: function handleTriggerClick(event) {
value: function handleTriggerClick() {
if (this.root.classList.contains('is-active')) {
this.root.classList.remove('is-active');
} else {
Expand Down
6 changes: 3 additions & 3 deletions docs/assets/js/bulmajs/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ var Bulma = {
* Current BulmaJS version.
* @type {String}
*/
VERSION: '0.2.0',
VERSION: '0.2.1',

/**
* Helper method to create a new plugin.
Expand Down Expand Up @@ -110,7 +110,7 @@ var Bulma = {
var plugin = element.getAttribute('data-bulma');

if (!Bulma.hasOwnProperty(plugin)) {
return console.warn('[BulmaJS] Plugin with the key \'' + plugin + '\' has not been registered.');
throw new Error('[BulmaJS] Plugin with the key \'' + plugin + '\' has not been registered.');
}

if (Bulma[plugin].hasOwnProperty('handleDomParsing')) {
Expand All @@ -120,7 +120,7 @@ var Bulma = {
}
};

document.addEventListener('DOMContentLoaded', function (event) {
document.addEventListener('DOMContentLoaded', function () {
Bulma.traverseDOM();
});

Expand Down
8 changes: 4 additions & 4 deletions docs/assets/js/bulmajs/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ var Bulma = {
* Current BulmaJS version.
* @type {String}
*/
VERSION: '0.2.0',
VERSION: '0.2.1',

/**
* Helper method to create a new plugin.
Expand Down Expand Up @@ -110,7 +110,7 @@ var Bulma = {
var plugin = element.getAttribute('data-bulma');

if (!Bulma.hasOwnProperty(plugin)) {
return console.warn('[BulmaJS] Plugin with the key \'' + plugin + '\' has not been registered.');
throw new Error('[BulmaJS] Plugin with the key \'' + plugin + '\' has not been registered.');
}

if (Bulma[plugin].hasOwnProperty('handleDomParsing')) {
Expand All @@ -120,7 +120,7 @@ var Bulma = {
}
};

document.addEventListener('DOMContentLoaded', function (event) {
document.addEventListener('DOMContentLoaded', function () {
Bulma.traverseDOM();
});

Expand Down Expand Up @@ -271,7 +271,7 @@ var Modal = function () {
}
}, {
key: 'handleDomParsing',
value: function handleDomParsing(element) {
value: function handleDomParsing() {
return;
}
}]);
Expand Down
Loading

0 comments on commit b9d613c

Please sign in to comment.