From bce0441003665105eaa80475e9f3aba4c1052092 Mon Sep 17 00:00:00 2001 From: Matt Mo Date: Wed, 25 Aug 2021 00:01:33 -0700 Subject: [PATCH] Resetting didn't like the new docs. --- ignite-html-select.js | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/ignite-html-select.js b/ignite-html-select.js index f1da84a..3b57bc4 100644 --- a/ignite-html-select.js +++ b/ignite-html-select.js @@ -11,7 +11,7 @@ import { IgniteTemplate } from "../ignite-html/ignite-template.js"; * @example * .years(1950, 2021, true) //Generates a select descending, 2021, 2020, 2019.. ect. */ -function years(from, to, placeholder = null, descending = false) { + IgniteTemplate.prototype.years = function(from, to, placeholder = null, descending = false) { //Generate html and populate the template with it. var html = ''; @@ -32,15 +32,13 @@ function years(from, to, placeholder = null, descending = false) { return this.innerHTML(html); }; -IgniteTemplate.prototype.years = years; - /** * Generates a series of months. * @param {String} placeholder The placeholder option, it's value will be 0, if set this text will be shown. * @param {Boolean} shorthand If true the option text will be the shorthand version of the month. * @returns {IgniteTemplate} This ignite template. */ -function months(placeholder = null, shorthand = true) { + IgniteTemplate.prototype.months = function(placeholder = null, shorthand = true) { //Generate html and populate the template with it. var html = ''; @@ -83,8 +81,6 @@ function months(placeholder = null, shorthand = true) { return this.innerHTML(html); } -IgniteTemplate.prototype.months = months; - /** * Generates a series of days. * @param {Number} from The starting day. @@ -93,7 +89,7 @@ IgniteTemplate.prototype.months = months; * @param {Boolean} descending Whether or not the to day is first and the from year is last. * @returns {IgniteTemplate} This ignite template. */ -function days(from = 1, to = 31, placeholder = null, descending = false) { + IgniteTemplate.prototype.days = function(from = 1, to = 31, placeholder = null, descending = false) { //Generate html and populate the template with it. var html = ''; @@ -114,8 +110,6 @@ function days(from = 1, to = 31, placeholder = null, descending = false) { return this.innerHTML(html); } -IgniteTemplate.prototype.days = days; - /** * Generates a series of numbers. * @param {Number} from The starting number. @@ -124,7 +118,7 @@ IgniteTemplate.prototype.days = days; * @param {Boolean} descending Whether or not the from number if first and the to number is last. * @returns {IgniteTemplate} This ignite template. */ -function numbers(from = 0, to = 100, placeholder = null, descending = false) { + IgniteTemplate.prototype.numbers = function(from = 0, to = 100, placeholder = null, descending = false) { //Generate html and populate the template with it. var html = ''; @@ -145,15 +139,13 @@ function numbers(from = 0, to = 100, placeholder = null, descending = false) { return this.innerHTML(html); } -IgniteTemplate.prototype.numbers = numbers; - /** * Generates a series of options based on key value pairs. * @param {Array|Object} options An array of strings or list of key value pairs to create options from. * @param {*} placeholder The placeholder option, it's value will be 0, if set this text will be shown. * @returns {IgniteTemplate} This ignite template. */ -function options(options, placeholder = null) { + IgniteTemplate.prototype.options = function(options, placeholder = null) { //Generate html and populate the template with it. var html = ''; @@ -173,6 +165,4 @@ function options(options, placeholder = null) { } return this.innerHTML(html); -} - -IgniteTemplate.prototype.options = options; \ No newline at end of file +} \ No newline at end of file