readd webshim polyfill for input[type=time]

needed by http://caniuse.com/#feat=input-datetime
was removed by 3563e41913
This commit is contained in:
jelhan 2015-12-07 21:51:07 +01:00
parent 52a20050f2
commit 2ec58668b8
6 changed files with 47 additions and 1 deletions

View file

@ -0,0 +1,6 @@
import FmInput from 'ember-form-master-2000/components/fm-input';
export default FmInput.reopen({
polyfill: function() {
this.$().updatePolyfill();
}.on('didInsertElement')
});

View file

@ -17,5 +17,6 @@ export default Ember.Component.extend({
var locale = this.$().val();
this.get('i18n').set('locale', locale);
this.get('moment').changeLocale(locale);
webshim.activeLang(locale);
}
});

View file

@ -0,0 +1,25 @@
import Ember from 'ember';
/* global webshim */
/*
* load webshim polyfill
* used for input[type="time"]
*/
export function initialize(application) {
let i18n = application.lookup('service:i18n');
webshim.setOptions({
waitReady: false,
});
webshim.setOptions("forms-ext", {
"widgets": {
"nopicker": true
}
});
webshim.polyfill('forms forms-ext');
}
export default {
name: 'webshim-polyfill',
initialize
};

View file

@ -8,6 +8,7 @@ export default {
i18n.set('locale', locale);
moment.changeLocale(locale);
webshim.activeLang(locale);
}
};

View file

@ -21,7 +21,8 @@
"ember-cli-moment-shim": "~0.2.0",
"moment-timezone": ">= 0.1.0",
"pretender": "^0.6.0",
"moment": ">= 2.8.0"
"moment": ">= 2.8.0",
"webshim": "~1.15.10"
},
"devDependencies": {
"ember-data-model-fragments": "1.13.1"

View file

@ -59,6 +59,18 @@ module.exports = function(defaults) {
app.import('bower_components/modernizr/modernizr.js');
// webshim
app.import({
development: 'bower_components/webshim/js-webshim/dev/polyfiller.js',
production: 'bower_components/webshim/js-webshim/minified/polyfiller.js'
});
trees.push(
pickFiles('bower_components/webshim/js-webshim/minified/shims', {
srcDir: '/',
destDir: '/assets/shims'
})
);
app.import('bower_components/jstimezonedetect/jstz.js');
// include api files into dist