Made IE text bug be detected through supportsGoodTextCharPos rather than browser sniffing

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2002 eee81c28-f429-11dd-99c0-75d572ba1ddd
This commit is contained in:
Alexis Deveria
2011-02-23 19:45:02 +00:00
parent 47001a9488
commit 0b7c8d489a
2 changed files with 15 additions and 43 deletions

View File

@@ -3862,8 +3862,8 @@ var textActions = canvas.textActions = function() {
for(var i=0; i<len; i++) {
var start = curtext.getStartPositionOfChar(i);
var end = curtext.getEndPositionOfChar(i);
// TODO: Make support property for this
if(svgedit.browser.isIE()) {
if(!svgedit.browser.supportsGoodTextCharPos()) {
var offset = canvas.contentW * current_zoom;
start.x -= offset;
end.x -= offset;
@@ -8783,32 +8783,4 @@ this.getPrivateMethods = function() {
return obj;
};
(function() {
// Temporary fix until MS fixes:
// https://connect.microsoft.com/IE/feedback/details/599257/
var disableAdvancedTextEdit = function() {
var curtext;
var textInput = $('#text').css({
position: 'static'
});
$.each(['mouseDown','mouseUp','mouseMove', 'setCursor', 'init', 'select', 'toEditMode'], function() {
textActions[this] = $.noop;
});
textActions.init = function(elem) {
curtext = elem;
$(curtext).unbind('dblclick').bind('dblclick', function() {
textInput.focus();
});
}
canvas.textActions = textActions;
}
if (!svgedit.browser.supportsTextCharPos()) {
disableAdvancedTextEdit();
}
})();
}