vendor/assets/javascripts/webshims/shims/combos/25.js in webshims-rails-1.14.4 vs vendor/assets/javascripts/webshims/shims/combos/25.js in webshims-rails-1.14.5
- old
+ new
@@ -547,12 +547,13 @@
var data = elementData(elem, 'implemented') || elementData(elem, 'implemented', {});
if(data[type]){
webshims.warn(type +' already implemented for element #'+elem.id);
return false;
}
+
data[type] = true;
- return true;
+ return !$(elem).hasClass('ws-nopolyfill');
},
extendUNDEFProp: function(obj, props){
$.each(props, function(name, prop){
if( !(name in obj) ){
obj[name] = prop;
@@ -1547,11 +1548,11 @@
webshim.defineNodeNameProperty('input', 'files', {
prop: {
writeable: false,
get: function(){
if(this.type != 'file'){return null;}
- if(!$(this).is('.ws-filereader')){
+ if(!$(this).hasClass('ws-filereader')){
webshim.info("please add the 'ws-filereader' class to your input[type='file'] to implement files-property");
}
return webshim.data(this, 'fileList') || [];
}
}
@@ -1806,18 +1807,19 @@
mediaelement.jarisEvent = {};
var localConnectionTimer;
var onEvent = {
onPlayPause: function(jaris, data, override){
var playing, type;
+ var idled = data.paused || data.ended;
if(override == null){
try {
playing = data.api.api_get("isPlaying");
} catch(e){}
} else {
playing = override;
}
- if(playing == data.paused){
+ if(playing == idled || playing == null){
data.paused = !playing;
type = data.paused ? 'pause' : 'play';
data._ppFlag = true;
trigger(data._elem, type);
@@ -2890,14 +2892,14 @@
};
var switchOptions = function(e){
var media, error, parent;
if(
($(e.target).is('audio, video') || ((parent = e.target.parentNode) && $('source', parent).last()[0] == e.target)) &&
- (media = $(e.target).closest('audio, video')) && !media.is('.nonnative-api-active')
+ (media = $(e.target).closest('audio, video')) && !media.hasClass('nonnative-api-active')
){
error = media.prop('error');
setTimeout(function(){
- if(!media.is('.nonnative-api-active')){
+ if(!media.hasClass('nonnative-api-active')){
if(error && switchErrors[error.code]){
options.preferFlash = true;
document.removeEventListener('error', switchOptions, true);
$('audio, video').each(function(){
webshims.mediaelement.selectSource(this);