Skip to content

Commit 753ed13

Browse files
author
Alexandr Shurigin
committed
fixed bug in IE. javaScript doesn't have trim function lol :)
forgot about it.
1 parent 7d5ce1f commit 753ed13

File tree

6 files changed

+29
-8
lines changed

6 files changed

+29
-8
lines changed

README.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# [browser.js](https://github.com/phpdude/browser.js/) v0.1.0
1+
# [browser.js](https://github.com/phpdude/browser.js/) v0.1.1
22

33
browser.js makes it easy to write conditional CSS based on device operating system and web browser.
44

examples/example.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/browser.js

Lines changed: 17 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/browser.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "browser.js",
3-
"version": "0.1.0",
3+
"version": "0.1.2",
44
"homepage": "https://github.com/phpdude/browser.js",
55
"description": "Browser & OS detection library. browser.js makes it easy to write conditional CSS based on device operating system and web browser<",
66
"author": {

src/browser.coffee

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Syntax sugar
2+
String::strip = -> if String::trim? then @trim() else @replace /^\s+|\s+$/g, ""
3+
String::lstrip = -> @replace /^\s+/g, ""
4+
String::rstrip = -> @replace /\s+$/g, ""
5+
16
# Save the previous value of browser variable
27
previousBrowser = window.browser
38

@@ -45,7 +50,7 @@ _hasClass = (class_name) ->
4550
# Normalize and set class name attribute for html tag
4651
_setClass = (class_names...) ->
4752
for class_name in class_names
48-
_doc_element.className = ((class_name || "").replace /\s+/, " ").trim()
53+
_doc_element.className = ((class_name || "").replace /\s+/, " ").strip()
4954

5055
# Add one or more CSS classes to the <html> element.
5156
_addClass = (class_names...) ->

0 commit comments

Comments
 (0)