-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdate-picker.js.map
22 lines (22 loc) · 16.7 KB
/
date-picker.js.map
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{
"version": 3,
"sources": [
"model.js",
"unit.js",
"unit-year.js",
"unit-month.js",
"unit-date.js",
"date-picker.js"
],
"names": [],
"mappings": "AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACxDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACnLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA",
"file": "date-picker.js",
"sourcesContent": [
"define('model',[],function(){\n\n\treturn Backbone.Model.extend({\n\t\t\n\t\tinitialize: function(attr){\n\t\t\t\n\t\t\tthis.date = attr.val ? moment(attr.val) : moment().startOf('year')\n\t\t\tthis.set('original_val', attr.val)\n\t\t\tthis.updateAttrs()\n\t\t\t\n\t\t},\n\t\t\n\t\tdateValue: function(){\n\t\t\treturn this.date.format('YYYY-MM-DD')\n\t\t},\n\t\t\n\t\tupdateAttrs: function(){\n\t\t\tvar val = this.get('val')\n\t\t\tthis.set({\n\t\t\t\t'val': val ? this.dateValue() : '',\n\t\t\t\t'year': val ? this.date.year() : '',\n\t\t\t\t'month': val ? this.date.month() : '',\n\t\t\t\t'date': val ? this.date.date() : ''\n\t\t\t})\n\t\t},\n\t\t\n\t\tchangeDate: function(key, val){\n\t\t\tif( key == 'date' ) key = 'day'\n\t\t\tthis.date.add(val, key);\n\t\t\tthis.save()\n\t\t},\n\t\t\n\t\tsetDate: function(key, val){\n\t\t\t\n\t\t\tif( key == 'month' && _.isString(val) )\n\t\t\t\tval = parseInt(val) - 1; // months are zero indexed\n\t\t\t\n\t\t\tthis.date.set(key, val);\n\t\t\tthis.save()\n\t\t},\n\t\t\n\t\tsave: function(){\n\t\t\tthis.set('val', this.dateValue())\n\t\t\tthis.updateAttrs()\n\t\t},\n\t\t\n\t\treset: function(){\n\t\t\tthis.set('val', this.get('original_val'))\n\t\t\tif( this.get('val') )\n\t\t\t\tthis.date = moment(this.get('val'))\n\t\t\tthis.updateAttrs()\n\t\t}\n\t\n\t});\n\n});\n",
"define('unit',[],function(){\n\n\treturn Backbone.View.extend({\n\t\n\t\tclassName: 'unit',\n\t\t\n\t\tevents: {\n\t\t\t'mousewheel': 'onMouseWheel',\n\t\t\t'mouseenter': 'activate',\n\t\t\t'mouseleave': 'deactivate',\n\t\t\t'click': 'activate'\n\t\t},\n\t\t\n\t\tval: function(){\n\t\t\treturn this.model.get(this.key)\n\t\t},\n\t\t\n\t\tformat: function(val){\n\t\t\treturn val === '' ? '__' : val;\n\t\t},\n\t\t\n\t\tvalidate: function(val){\n\t\t\treturn false\n\t\t},\n\t\t\n\t\tinitialize: function(opts){\n\t\t\t\n\t\t\tthis.el.classList.add('unit-'+this.key)\n\t\t\t\n\t\t\tif( this.options.divider )\n\t\t\t\tthis.el.dataset.divider = this.options.divider\n\t\t\t\n\t\t\tthis._onType = this.onType.bind(this)\n\t\t\t\n\t\t\tthis.delta = 0\n\t\t\tthis.typedVal = '';\n\t\t\t\n\t\t\tthis.listenTo(this.model, 'change:'+this.key, this.render)\n\t\t},\n\t\t\n\t\trender: function(){\n\t\t\t\n\t\t\tif( this.typedVal )\n\t\t\t\tthis.$el.html( this.typedVal )\n\t\t\telse\n\t\t\t\tthis.$el.html( this.format(this.val()) )\n\t\t\t\n\t\t\treturn this;\n\t\t},\n\t\t\n\t\tonMouseWheel: function(e){\n\t\t\t\n\t\t\tclearTimeout(this.onMouseWheelTimeout)\n\t\t\t\n\t\t\te.preventDefault()\n\t\t\te.stopPropagation()\n\t\t\t\n\t\t\te = e.originalEvent\n\t\t\t// var delta = Math.max(-1, Math.min(1, (e.wheelDelta || -e.detail)));\n\t\t\tvar delta = e.wheelDelta\n\t\t\t\n\t\t\t// if scrolling switched directions, reset delta back to 0\n\t\t\tif( (this.delta < 0 && delta > 0) || (this.delta > 0 && delta < 0) )\n\t\t\t\tthis.delta = 0;\n\t\t\t\t\n\t\t\tthis.delta += delta;\n\t\t\t\n\t\t\t// if we've scrolled enough, trigger a value change\n\t\t\tif( Math.abs(this.delta) >= this.options.deltaThreshold ){\n\t\t\t\t\n\t\t\t\tthis.delta < 0 ? this.decrease() : this.increase()\n\t\t\t\t\n\t\t\t\t// then reset the delta to begin counting the threshold again\n\t\t\t\tthis.delta = 0;\n\t\t\t}\n\t\t\t\n\t\t\t// reset delta after scrolling has stopped\n\t\t\tthis.onMouseWheelTimeout = setTimeout(function(){\n\t\t\t\tthis.delta = 0;\n\t\t\t}.bind(this),100)\n\t\t\t\n\t\t\treturn false;\n\t\t},\n\t\t\n\t\tdecrease: function(){\n\t\t\tthis.model.changeDate(this.key, -1)\n\t\t},\n\t\t\n\t\tincrease: function(){\n\t\t\tthis.model.changeDate(this.key, 1)\n\t\t},\n\t\t\n\t\tactivate: function(){\n\t\t\tif( window.__activeDatePickerUnit ) window.__activeDatePickerUnit.deactivate()\n\t\t\twindow.__activeDatePickerUnit = this;\n\t\t\tthis.el.classList.add('active')\n\t\t\twindow.addEventListener('keydown', this._onType)\n\t\t},\n\t\t\n\t\tdeactivate: function(){\n\t\t\tif( window.__activeDatePickerUnit == this )\n\t\t\t\twindow.__activeDatePickerUnit = null;\n\t\t\tthis.el.classList.remove('active')\n\t\t\twindow.removeEventListener('keydown', this._onType)\n\t\t\t\n\t\t\tthis.useTypedValue()\n\t\t},\n\t\t\n\t\tisActive: function(){\n\t\t\treturn this.el.classList.contains('active')\n\t\t},\n\t\t\n\t\tonType: function(e){\n\t\t\t\n\t\t\t// backspace\n\t\t\tif( e.which == 8 ){\n\t\t\t\te.preventDefault()\n\t\t\t\te.stopPropagation()\n\t\t\t\tthis.typedVal = this.typedVal.substr(0, this.typedVal.length-1)\n\t\t\t\tthis.render();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t// esc\n\t\t\tif( e.which == 27 ){\n\t\t\t\te.preventDefault()\n\t\t\t\te.stopPropagation()\n\t\t\t\tthis.typedVal = '';\n\t\t\t\tthis.parentView.reset()\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t// tab, left arrow, right arrow, enter\n\t\t\tif( e.which == 9 || e.which == 37 || e.which == 39 || e.which == 13){\n\t\t\t\te.preventDefault()\n\t\t\t\te.stopPropagation()\n\t\t\t\t\n\t\t\t\tif( e.which == 13 )\n\t\t\t\t\tthis.deactivate()\n\t\t\t\telse if( e.shiftKey || e.which == 37 )\n\t\t\t\t\tthis.parentView.activatePrev()\n\t\t\t\telse\n\t\t\t\t\tthis.parentView.activateNext()\n\t\t\t\t\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t// only accept numbers\n\t\t\t// TODO: I think I need to get codes for number pad too\n\t\t\tif( e.which < 48 || e.which > 57 ) return;\n\t\t\t\n\t\t\tthis.typedVal += String.fromCharCode(e.which) // keep as a string so the values concatenate\n\t\t\t\n\t\t\tthis.render();\n\t\t\t\n\t\t\tif( this.maxLength && this.typedVal.length >= this.maxLength )\n\t\t\t\tthis.useTypedValue()\n\t\t\telse if( !this.minLength || this.typedVal.length >= this.minLength )\n\t\t\t\tthis._onTypeTimeout = setTimeout(this.useTypedValue.bind(this), this.options.typeDelay)\n\t\t},\n\t\t\n\t\ttypedValueIsValid: function(){\n\t\t\treturn this.validate(this.typedVal)\n\t\t},\n\t\t\n\t\tuseTypedValue: function(){\n\t\t\t\n\t\t\tif( this.typedValueIsValid() ){\n\t\t\t\tthis.model.setDate(this.key, this.typedVal)\n\t\t\t\tthis.parentView.activateNext(false)\n\t\t\t}\n\t\t\t\n\t\t\tthis.typedVal = '';\n\t\t\tthis.render();\n\t\t}\n\t\n\t});\n\n});\n",
"define('unit-year',['unit'], function(UnitView){\n\n\treturn UnitView.extend({\n\t\t\n\t\tkey: 'year',\n\t\tminLength: 4,\n\t\tmaxLength: 4,\n\t\t\n\t\tformat: function(val){\n\t\t\treturn val === '' ? this.options.placeholder : val;\n\t\t},\n\t\t\n\t\t// `val` will always be a number string or empty string\n\t\tvalidate: function(val){\n\t\t\tif( !val || val.length !== 4 ) return false\n\t\t\treturn true\n\t\t}\n\t\t\n\t})\n\n});\n",
"define('unit-month',['unit'], function(UnitView){\n\n\treturn UnitView.extend({\n\t\t\n\t\tkey: 'month',\n\t\tmaxLength: 2,\n\t\t\n\t\tformat: function(val){\n\t\t\tif( _.isFunction(this.options.format) )\n\t\t\t\treturn this.options.format(val)\n\t\t\telse if( val === '' )\n\t\t\t\treturn this.options.placeholder\n\t\t\telse if( this.options.format == 'long' )\n\t\t\t\treturn moment.months()[val]\n\t\t\telse if( this.options.format == 'short' )\n\t\t\t\treturn moment.monthsShort()[val]\n\t\t\telse\n\t\t\t\treturn _.lpad(val+1, 2, '0')\n\t\t},\n\t\t\n\t\t// `val` will always be a number string or empty string\n\t\tvalidate: function(val){\n\t\t\tif( !val || val.length > 2 ) return false\n\t\t\treturn true\n\t\t}\n\t\t\n\t})\n\n});\n",
"define('unit-date',['unit'], function(UnitView){\n\n\treturn UnitView.extend({\n\t\t\n\t\tkey: 'date',\n\t\tmaxLength: 2,\n\t\t\n\t\tformat: function(val){\n\t\t\tif( _.isFunction(this.options.format) )\n\t\t\t\treturn this.options.format(val)\n\t\t\telse if( val === '' )\n\t\t\t\treturn this.options.placeholder\n\t\t\telse\n\t\t\t\treturn _.lpad(val, 2, '0')\n\t\t},\n\t\t\n\t\t// `val` will always be a number string or empty string\n\t\tvalidate: function(val){\n\t\t\tif( !val || val.length > 2 ) return false\n\t\t\treturn true\n\t\t}\n\t\t\n\t})\n\n});\n",
"/*\n\tBackbone.js Date Picker\n\t\n\t@author Kevin Jantzer, Blackstone Audio Inc.\n\t@since 2017-04-26\n\t\n\t@TODO\n\t- add ability to scroll a unit and only change that unit (right now, if scrolling from Dec to Jan, the year will change)\n\t- add support for time?\n\t- method for \"setting\" the date after initialization\n\t- add date range limiting (min and/or max)\n\t- add option for turning scroll feature off?\n*/\ndefine('date-picker',[\n\t'model',\n\t'unit-year',\n\t'unit-month',\n\t'unit-date'\n], function(Model, YearView, MonthView, DateView){\n\n\treturn Backbone.View.extend({\n\t\n\t\tclassName: 'datepicker',\n\t\t\n\t\tevents: {\n\t\t\t'mouseenter': 'onHover',\n\t\t\t'mouseleave': 'blur'\n\t\t},\n\t\t\n\t\tappendTo: function(el){\n\t\t\tif( _.isString(el) )\n\t\t\t\tel = document.querySelector(el)\n\t\t\tthis.render().$el.appendTo(el)\n\t\t},\n\t\t\n\t\tdefaultOpts: {\n\t\t\tappendTo: null,\n\t\t\tval: '',\n\t\t\tformat: 'y-m-d',\n\t\t\tvalFormat: 'YYYY-MM-DD',\n\t\t\tclassName: '',\n\t\t\tdeltaThreshold: 70, // how much scrolling is needed to change values\n\t\t\ttypeDelay: 340, // how long between keystrokes before using value\n\t\t\tnavLink: true, // when navigating units and reaching the end, will jump to next date picker if right next\n\t\t\tsaveOnBlur: true,\n\t\t\tonSave: null,\n\t\t\tonBlur: null,\n\t\t\t\n\t\t\t// options for each unit\n\t\t\ty: {\n\t\t\t\tplaceholder: 'yyyy'\n\t\t\t}, \n\t\t\tm: {\n\t\t\t\tformat: '', // short, long, fn()\n\t\t\t\tplaceholder: 'mm'\n\t\t\t},\n\t\t\td: {\n\t\t\t\tformat: '', // fn()\n\t\t\t\tplaceholder: 'dd'\n\t\t\t}\n\t\t},\n\t\t\n\t\tinitialize: function(){\n\t\t\t\n\t\t\tif( !window.moment ) return;\n\t\t\t\n\t\t\tthis.el.datepicker = this;\n\t\t\t\n\t\t\tthis.options = _.extend({}, this.defaultOpts, this.options)\n\t\t\tthis.format = this.options.format.toLowerCase().split('')\n\t\t\tthis.unitViews = []\n\t\t\tthis.model = new Model({val: this.options.val})\n\t\t\t\n\t\t\tif( this.options.className )\n\t\t\t\tthis.el.classList.add(this.options.className)\n\t\t\t\t\n\t\t\tif( this.options.appendTo )\n\t\t\t\tthis.appendTo(this.options.appendTo)\n\t\t},\n\t\t\n\t\trender: function(){\n\t\t\t\n\t\t\tif( !window.moment ){\n\t\t\t\tthis.$el.html('missing moment.js')\n\t\t\t\treturn this;\n\t\t\t}\n\t\t\t\n\t\t\twindow.dp = this; // TEMP\n\t\t\t\n\t\t\t// only render once\n\t\t\tif( this.unitViews.length == 0 )\n\t\t\t\tthis.format.forEach(this.renderUnit.bind(this))\n\t\t\t\n\t\t\treturn this\n\t\t},\n\t\t\n\t\trenderUnit: function(key){\n\t\t\tvar View;\n\t\t\tswitch(key){\n\t\t\t\tcase 'y': View = YearView; break;\n\t\t\t\tcase 'm': View = MonthView; break;\n\t\t\t\tcase 'd': View = DateView; break;\n\t\t\t}\n\t\t\t\n\t\t\tif( !View ){\n\t\t\t\tthis.divider = key\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tvar opts = _.extend({\n\t\t\t\tdivider: this.divider,\n\t\t\t\tdeltaThreshold: this.options.deltaThreshold,\n\t\t\t\ttypeDelay: this.options.typeDelay,\n\t\t\t\tmodel: this.model\n\t\t\t}, this.defaultOpts[key], this.options[key])\n\t\t\t\n\t\t\tvar view = new View(opts)\n\t\t\tview.parentView = this\n\t\t\tthis.$el.append( view.render().el )\n\t\t\t\n\t\t\tthis.unitViews.push(view)\n\t\t\t\n\t\t\tthis.divider = ''\n\t\t},\n\t\t\n\t\tactiveView: function(){\n\t\t\tvar view\n\t\t\tthis.unitViews.forEach(function(v){\n\t\t\t\tif( v.isActive() ) view = v\n\t\t\t})\n\t\t\treturn view\n\t\t},\n\t\t\n\t\t_activate: function(jump, loop){\n\t\t\tvar view = this.activeView();\n\t\t\tvar indx = this.unitViews.indexOf(view)\n\t\t\t\n\t\t\tif( view ){\n\t\t\t\tview.deactivate()\n\t\t\t\tindx += jump\n\t\t\t}else{\n\t\t\t\tindx = 0;\n\t\t\t}\n\t\t\t\n\t\t\tif( indx > this.unitViews.length - 1){\n\t\t\t\tif( loop === false ) return\n\t\t\t\tif( this.options.navLink && this.el.nextElementSibling && this.el.nextElementSibling.datepicker ){\n\t\t\t\t\tthis.blur();\n\t\t\t\t\tthis.el.nextElementSibling.datepicker.focus()\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tindx = 0\n\t\t\t}else if( indx < 0 ){\n\t\t\t\tif( loop === false ) return\n\t\t\t\tif( this.options.navLink && this.el.previousElementSibling && this.el.previousElementSibling.datepicker ){\n\t\t\t\t\tthis.blur();\n\t\t\t\t\tthis.el.previousElementSibling.datepicker.focusLast()\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tindx = this.unitViews.length - 1\n\t\t\t}\n\t\t\t\n\t\t\tview = this.unitViews[indx]\n\t\t\tview && view.activate()\n\t\t},\n\t\t\n\t\tactivateNext: function(loop){\n\t\t\tthis._activate(1, loop)\n\t\t},\n\t\t\n\t\tactivatePrev: function(loop){\n\t\t\tthis._activate(-1, loop)\n\t\t},\n\t\t\n\t\tfocus: function(num){\n\t\t\tthis.blur()\n\t\t\tthis.unitViews[num||0].activate()\n\t\t},\n\t\t\n\t\tfocusLast: function(){\n\t\t\tthis.focus(this.unitViews.length-1)\n\t\t},\n\t\t\n\t\tblur: function(){\n\t\t\t\n\t\t\tif( !window.moment ) return;\n\t\t\t\n\t\t\tvar view = this.activeView()\n\t\t\tview && view.deactivate()\n\t\t\t\n\t\t\tthis.el.classList.remove('editing');\n\t\t\t\n\t\t\t// value is different than last time so trigger a save request\n\t\t\tif( this.model.get('val') != this.options.val ){\n\t\t\t\t\n\t\t\t\t// if the value is the same as the original, dont consider unsaved\n\t\t\t\tif( this.model.get('val') === this.model.get('original_val') )\n\t\t\t\t\tthis.el.classList.remove('unsaved');\n\t\t\t\telse\n\t\t\t\t\tthis.el.classList.add('unsaved');\n\t\t\t\t\n\t\t\t\tthis.options.val = this.model.dateValue()\n\t\t\t\t\n\t\t\t\tif( this.options.saveOnBlur )\n\t\t\t\t\tthis.save();\n\t\t\t\t\n\t\t\t\tif( this.options.onSave )\n\t\t\t\t\tthis.options.onSave(this, this.value())\n\t\t\t}\n\t\t\t\n\t\t\tif( this.options.onBlur ){\n\t\t\t\tthis.options.onBlur(this)\n\t\t\t}\n\t\t\t\n\t\t},\n\t\t\n\t\tvalue: function(){\n\t\t\treturn this.model.date.format(this.options.valFormat)\n\t\t},\n\t\t\n\t\treset: function(){\n\t\t\tthis.model.reset()\n\t\t\tif( this.model.get('val') === this.model.get('original_val') )\n\t\t\t\tthis.el.classList.remove('unsaved');\n\t\t},\n\t\t\n\t\tsave: function(){\n\t\t\tthis.model.set('original_val', this.model.get('val'))\n\t\t\tthis.el.classList.remove('unsaved');\n\t\t},\n\t\t\n\t\tonHover: function(){\n\t\t\tthis.el.classList.add('editing');\n\t\t}\n\t\n\t});\n\n});\n"
]
}