Skip to content
Browse files

Fix IE8 issues with string.trim and such

  • Loading branch information...
1 parent 0309f05 commit 9e282e17da9703942b6008d945c0e064318e0dd7 @wachunga committed
Showing with 10 additions and 10 deletions.
  1. +1 −1 public/js/IssueManager.js
  2. +3 −3 public/js/ProjectView.js
  3. +4 −4 public/js/TagFilter.js
  4. +1 −1 public/js/UserManager.js
  5. +1 −1 public/js/main.js
View
2 public/js/IssueManager.js
@@ -138,7 +138,7 @@ define([
};
function getFilterInputValue() {
- return $("#issueFilter").val().trim();
+ return $.trim($("#issueFilter").val());
}
IssueManager.prototype.resetFilters = function () {
View
6 public/js/ProjectView.js
@@ -71,7 +71,7 @@ function ($, _, ko, timeago, tooltips, util, Issue, Notifier, UserManager, Messa
};
function isCommand(input) {
- return input.trim().charAt(0) === "/";
+ return $.trim(input).charAt(0) === "/";
}
function ArgError(message) {
@@ -143,8 +143,8 @@ function ($, _, ko, timeago, tooltips, util, Issue, Notifier, UserManager, Messa
try {
var matches = input.match(/[:\/]([\S]+)(?:\s+(.*))?/);
- var cmd = matches[1] && matches[1].trim();
- var rest = matches[2] && matches[2].trim();
+ var cmd = matches[1] && $.trim(matches[1]);
+ var rest = matches[2] && $.trim(matches[2]);
var id;
switch (cmd.toLowerCase()) {
View
8 public/js/TagFilter.js
@@ -2,13 +2,13 @@ define(['underscore', 'ko'], function (_, ko) {
var TagState = {
off: -1,
- default: 0,
+ 'default': 0,
on: 1
};
function TagFilter(label) {
this.label = label;
- this.state = ko.observable(TagState.default);
+ this.state = ko.observable(TagState['default']);
}
TagFilter.prototype.getSymbol = function () {
@@ -23,7 +23,7 @@ define(['underscore', 'ko'], function (_, ko) {
};
TagFilter.prototype.isActive = function () {
- return this.state() !== TagState.default;
+ return this.state() !== TagState['default'];
};
TagFilter.prototype.toggle = function () {
@@ -41,7 +41,7 @@ define(['underscore', 'ko'], function (_, ko) {
TagFilter.resetAll = function (tagFilters) {
_.each(tagFilters, function (tagFilter) {
- tagFilter.state(TagState.default);
+ tagFilter.state(TagState['default']);
});
};
View
2 public/js/UserManager.js
@@ -36,7 +36,7 @@ define(['jquery', 'ko', 'underscore', 'util'], function ($, ko, _, util) {
UserManager.prototype.attemptLogin = function () {
this.invalidName(false);
var name = this.$nameInput.val();
- if (!name || name.trim().length < 3) { // TODO: disallow other chars?
+ if (!name || $.trim(name).length < 3) { // TODO: disallow other chars?
this.invalidName(true);
return;
}
View
2 public/js/main.js
@@ -19,7 +19,7 @@ require(['jquery', 'ko'], function ($, ko) {
var viewModel = {
error: ko.observable(),
submitForm: function (form) {
- var name = $('#projectNameInput').val().trim();
+ var name = $.trim($('#projectNameInput').val());
if (!name || name.length < 3) {
this.error('Why so terse? You can do better.');
return false;

0 comments on commit 9e282e1

Please sign in to comment.
Something went wrong with that request. Please try again.