Permalink
Browse files

Fixed bug in markItUp-editor causing feature detection being used inc…

…orrectly
  • Loading branch information...
Chi Shang Cheng
Chi Shang Cheng committed Jun 28, 2011
1 parent aee8846 commit b988ffa3ab07f3de1d0de0903b223cab5ca9af74
Showing with 4 additions and 7 deletions.
  1. +4 −7 fiber/static/fiber/js/fiber.markitup.js
@@ -7,9 +7,6 @@ Fiber.enhance_textarea = function(textarea) {
// Helper class to retrieve/replace user text selection in IE
var UserSelectionIE = function() {
this.textRange = (document.selection && document.selection.createRange) ? document.selection.createRange() : false;
- if (!this.textRange) {
- return false;
- }
};
UserSelectionIE.prototype.markItUp = function(options) {
if (this.textRange && options) {
@@ -41,7 +38,7 @@ Fiber.enhance_textarea = function(textarea) {
page_select_dialog.action_click = function() {
var selected_page_path = this.uiDialog.find('a.ui-state-active').attr('href');
- if (userSelectionIE) {
+ if (userSelectionIE.textRange) {
// Replace textarea selection for IE
userSelectionIE.markItUp({
openWith: '"',
@@ -70,7 +67,7 @@ Fiber.enhance_textarea = function(textarea) {
file_select_dialog.action_click = function() {
var selected_file_path = $(this.uiDialog.find('tr.ui-state-highlight td')[0]).text();
- if (userSelectionIE) {
+ if (userSelectionIE.textRange) {
// Replace textarea selection for IE
userSelectionIE.markItUp({
openWith: '"',
@@ -99,7 +96,7 @@ Fiber.enhance_textarea = function(textarea) {
image_select_dialog.action_click = function() {
var selected_image_path = $(this.uiDialog.find('tr.ui-state-highlight td')[0]).text();
- if (userSelectionIE) {
+ if (userSelectionIE.textRange) {
// Replace textarea selection for IE
userSelectionIE.markItUp({
openWith: '"',
@@ -129,7 +126,7 @@ Fiber.enhance_textarea = function(textarea) {
var selected_image_path = $(this.uiDialog.find('tr.ui-state-highlight td')[0]).text();
var selected_image_textile = '!' + selected_image_path + '!';
- if (userSelectionIE) {
+ if (userSelectionIE.textRange) {
// Replace textarea selection for IE
userSelectionIE.markItUp({
replaceWith: selected_image_textile

0 comments on commit b988ffa

Please sign in to comment.