bulma-extensions
Advanced tools
Comparing version 6.0.0 to 6.0.1
@@ -17,7 +17,10 @@ ready(function () { | ||
var calendars = bulmaCalendar.attach('#datepickerDemoDefault'); | ||
[].forEach.call(calendars, function(calendar) { | ||
calendar.on('select', function (datePicker) { | ||
console.log('Selected date: ' + datePicker.data.value()); | ||
}); | ||
}); | ||
// To access to bulmaCalendar instance of an element | ||
const element = document.querySelector('#datepickerDemoDefault'); | ||
if (element) { | ||
// bulmaCalendar instance is available as element.bulmaCalendar | ||
element.bulmaCalendar.on('select', function(datepicker) { | ||
console.log(datepicker.data.value()); | ||
}); | ||
} | ||
@@ -24,0 +27,0 @@ bulmaCalendar.attach('#datepickerDemoDialog', { |
@@ -76,5 +76,11 @@ import * as utils from './utils/index'; | ||
const datetimepickers = types.isString(selector) ? document.querySelectorAll(selector) : Array.isArray(selector) ? selector : [selector]; | ||
[].forEach.call(datetimepickers, datetimepicker => { | ||
instances.push(new bulmaCalendar(datetimepicker, options)); | ||
const elements = types.isString(selector) ? document.querySelectorAll(selector) : Array.isArray(selector) ? selector : [selector]; | ||
[].forEach.call(elements, element => { | ||
if (typeof element[this.constructor.name] === 'undefined') { | ||
const instance = new bulmaCalendar(element, options); | ||
element.bulmaCalendar = instance; | ||
instances.push(instance); | ||
} else { | ||
instances.push(element[this.constructor.name]); | ||
} | ||
}); | ||
@@ -81,0 +87,0 @@ |
@@ -6,3 +6,3 @@ { | ||
"style": "./dist/css/bulma-extensions.min.css", | ||
"version": "6.0.0", | ||
"version": "6.0.1", | ||
"scripts": { | ||
@@ -9,0 +9,0 @@ "build": "gulp", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3287279
57070