diff --git a/README.md b/README.md index 4c95a8fd8c..f29916027f 100644 --- a/README.md +++ b/README.md @@ -5,13 +5,13 @@ Modernizr Modernizr tests which native CSS3 and HTML5 features are available in the current UA and makes the results available to you in two ways: -as properties on a global Modernizr object, and as classes on the +as properties on a global `Modernizr` object, and as classes on the `` element. This information allows you to progressively enhance your pages with a granular level of control over the experience. Modernizr has an optional (*not included*) conditional resource loader -called Modernizr.load(), based on Yepnope.js ([yepnopejs.com](http://yepnopejs.com/)). -To get a build that includes Modernizr.load(), as well as choosing +called `Modernizr.load()`, based on Yepnope.js ([yepnopejs.com](http://yepnopejs.com/)). +To get a build that includes `Modernizr.load()`, as well as choosing which tests to include, go to [www.modernizr.com/download/](http://www.modernizr.com/download/) [Full documentation on modernizr.com/docs/](http://www.modernizr.com/docs/) diff --git a/modernizr.js b/modernizr.js index b198b20b7f..b320c9678d 100644 --- a/modernizr.js +++ b/modernizr.js @@ -457,7 +457,8 @@ window.Modernizr = (function( window, document, undefined ) { }; tests['draganddrop'] = function() { - return isEventSupported('dragstart') && isEventSupported('drop'); + var div = document.createElement('div'); + return ('draggable' in div) || ('ondragstart' in div && 'ondrop' in div); }; // Mozilla is targeting to land MozWebSocket for FF6 @@ -1122,7 +1123,7 @@ window.Modernizr = (function( window, document, undefined ) { // Remove "no-js" class from element, if it exists: - docElement.className = docElement.className.replace(/\bno-js\b/, '') + docElement.className = docElement.className.replace(/(^|\s)no-js(\s|$)/, '$1$2') // Add the new classes to the element. + (enableClasses ? ' js ' + classes.join(' ') : ''); diff --git a/test/index.html b/test/index.html index 0dd08fce57..4e0241e74c 100644 --- a/test/index.html +++ b/test/index.html @@ -1,5 +1,5 @@ - +