From 5a657dda6564db7c9122e2ecaaa7f76e4749dd5b Mon Sep 17 00:00:00 2001 From: Matteo Tomasini Date: Tue, 5 Apr 2011 11:45:51 +0200 Subject: [PATCH] Fixed selection in Editor; now returns html instead of plain text. --- WebApplication/Editor.ascx | 4 ++-- WebApplication/Editor.ascx.designer.cs | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/WebApplication/Editor.ascx b/WebApplication/Editor.ascx index 24d79ee..78fa590 100644 --- a/WebApplication/Editor.ascx +++ b/WebApplication/Editor.ascx @@ -49,9 +49,9 @@ function getSelectedText() { if(document.all) - var selected=iframe.document.selection.createRange().text; + var selected=iframe.document.selection.createRange().htmlText; else - var selected=iframe.document.defaultView.getSelection().getRangeAt(0); + var selected=iframe.document.defaultView.getSelection().getRangeAt(0).commonAncestorContainer.innerHTML; return selected; } diff --git a/WebApplication/Editor.ascx.designer.cs b/WebApplication/Editor.ascx.designer.cs index e92890a..5bff3ea 100644 --- a/WebApplication/Editor.ascx.designer.cs +++ b/WebApplication/Editor.ascx.designer.cs @@ -1,10 +1,9 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.4952 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------