Skip to content

Commit

Permalink
Added: [email protected] Fixed IE11 text-inpus-focus issues as we…
Browse files Browse the repository at this point in the history
…ll as a major issue in canvas-designer-widget.js that what destroying "on message" handler.
  • Loading branch information
muaz-khan committed Jan 17, 2016
1 parent a944f27 commit 6856286
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 9 deletions.
5 changes: 3 additions & 2 deletions canvas-designer-widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ var CanvasDesigner = (function() {
}
}

window.addEventListener('message', onMessage, false);

return {
appendTo: function(parentNode) {
iframe = document.createElement('iframe');
Expand All @@ -49,6 +47,9 @@ var CanvasDesigner = (function() {
iframe.style.height = '100%';
iframe.style.border = 0;
parentNode.appendChild(iframe);

window.removeEventListener('message', onMessage);
window.addEventListener('message', onMessage, false);
},
destroy: function() {
if(iframe) {
Expand Down
3 changes: 2 additions & 1 deletion dev/decorator.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ var tools = {
arc: true,
bezier: true,
quadratic: true,
text: true
text: true,
image: true
};

if (params.tools) {
Expand Down
10 changes: 10 additions & 0 deletions dev/text-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ textInput.onkeyup = function(e) {
textInput.style.color = fillStyle == 'transparent' ? 'Black' : fillStyle;

setTimeout(function() {
if (!!textInput.select && typeof textInput.select === 'function') {
textInput.select();
return;
}

textInput.focus();
}, 200);
};
Expand Down Expand Up @@ -69,6 +74,11 @@ var textHandler = {
textInput.style.color = fillStyle == 'transparent' ? 'Black' : fillStyle;

setTimeout(function() {
if (!!textInput.select && typeof textInput.select === 'function') {
textInput.select();
return;
}

textInput.focus();
}, 200);
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "canvas-designer",
"preferGlobal": false,
"version": "1.0.0",
"version": "1.0.1",
"author": {
"name": "Muaz Khan",
"email": "[email protected]",
Expand Down
15 changes: 13 additions & 2 deletions widget.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Last time updated at Monday, January 11th, 2016, 1:38:19 PM
// Last time updated at Sunday, January 17th, 2016, 6:32:30 PM

// _______________
// Canvas-Designer
Expand Down Expand Up @@ -533,7 +533,8 @@
arc: true,
bezier: true,
quadratic: true,
text: true
text: true,
image: true
};

if (params.tools) {
Expand Down Expand Up @@ -2088,6 +2089,11 @@
textInput.style.color = fillStyle == 'transparent' ? 'Black' : fillStyle;

setTimeout(function() {
if (!!textInput.select && typeof textInput.select === 'function') {
textInput.select();
return;
}

textInput.focus();
}, 200);
};
Expand Down Expand Up @@ -2141,6 +2147,11 @@
textInput.style.color = fillStyle == 'transparent' ? 'Black' : fillStyle;

setTimeout(function() {
if (!!textInput.select && typeof textInput.select === 'function') {
textInput.select();
return;
}

textInput.focus();
}, 200);
},
Expand Down
6 changes: 3 additions & 3 deletions widget.min.js

Large diffs are not rendered by default.

0 comments on commit 6856286

Please sign in to comment.