Permalink
Browse files

Remove useless disabled attribute on LI tags, use classes instead of.

  • Loading branch information...
1 parent 45f295e commit 7d4da1d8277ef0f93da457d0e3d2659bea8dbd75 @akzhan akzhan committed May 6, 2011
Showing with 9 additions and 7 deletions.
  1. +3 −0 jquery.wysiwyg.css
  2. +4 −7 jquery.wysiwyg.js
  3. +2 −0 jquery.wysiwyg.old-school.css
View
@@ -11,6 +11,9 @@ div.wysiwyg ul.toolbar li { text-indent: -5000px; opacity: 0.85; filter: alpha(o
div.wysiwyg ul.toolbar li.wysiwyg-button-hover, div.wysiwyg ul.toolbar li.active { opacity: 1.00; filter:alpha(opacity=100); border: 1px outset rgb(224, 224, 224); }
div.wysiwyg ul.toolbar li.active { background-color: rgb(255, 255, 64); border: 1px solid rgb(208, 208, 208); border-left-color: #aaa; border-top-color: #aaa; margin: 0; }
+div.wysiwyg ul.toolbar li.disabled, div.wysiwyg ul.toolbar li.wysiwyg-button-hover.disabled, div.wysiwyg ul.toolbar li.active.disabled { opacity: 0.5; filter:alpha(opacity=50); border: 0px none transparent; padding: 1px; cursor: auto; }
+
+
div.wysiwyg ul.toolbar li.bold { background-position: 0 -16px; }
div.wysiwyg ul.toolbar li.italic { background-position: -16px -16px; }
div.wysiwyg ul.toolbar li.strikeThrough { background-position: -32px -16px; }
View
@@ -182,9 +182,7 @@
if (li.hasClass("html")) {
li.removeClass("active");
} else {
- // TODO: Will need to support jQuery 1.6 changes
- // I suppose to make $.fn.wysiwyg.prop method that maps to attr, removeAttr or prop methods of jQuery depending of its version.
- li.removeAttr("disabled");
+ li.removeClass('disabled');
}
});
} else {
@@ -212,8 +210,7 @@
li.addClass("active");
} else {
if (false === li.hasClass("fullscreen")) {
- li.removeClass("active");
- li.attr("disabled", "disabled");
+ li.removeClass("active").addClass('disabled');
}
}
});
@@ -728,7 +725,7 @@
.attr("title", tooltip)
.hover(this.addHoverClass, this.removeHoverClass)
.click(function () {
- if ($(this).attr("disabled")) {
+ if ($(this).hasClass("disabled")) {
return false;
}
@@ -757,7 +754,7 @@
.attr("title", tooltip)
.hover(this.addHoverClass, this.removeHoverClass)
.click(function () {
- if ($(this).attr("disabled")) {
+ if ($(this).hasClass("disabled")) {
return false;
}
@@ -11,6 +11,8 @@ div.wysiwyg ul.toolbar li { text-indent: -5000px; opacity: 0.85; filter: alpha(o
div.wysiwyg ul.toolbar li.wysiwyg-button-hover, div.wysiwyg ul.toolbar li.active { opacity: 1.00; filter:alpha(opacity=100); border: 1px outset rgb(224, 224, 224); }
div.wysiwyg ul.toolbar li.active { background-color: rgb(255, 255, 64); border: 1px solid rgb(208, 208, 208); border-left-color: #aaa; border-top-color: #aaa; margin: 0; }
+div.wysiwyg ul.toolbar li.disabled, div.wysiwyg ul.toolbar li.wysiwyg-button-hover.disabled, div.wysiwyg ul.toolbar li.active.disabled { opacity: 0.5; filter:alpha(opacity=50); border: 0px none transparent; padding: 1px; pointer: auto; }
+
div.wysiwyg ul.toolbar li.bold { background-position: 0 -16px; }
div.wysiwyg ul.toolbar li.italic { background-position: -16px -16px; }
div.wysiwyg ul.toolbar li.strikeThrough { background-position: -32px -16px; }

0 comments on commit 7d4da1d

Please sign in to comment.