Skip to content
This repository was archived by the owner on Jul 28, 2024. It is now read-only.

Couple of issues fixed #30

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/wysihat/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,9 @@ WysiHat.Commands = (function(window) {
} catch(e) { return null; }
}

document.activeElement.fire("field:change");
if (document.activeElement.fire) {
document.activeElement.fire("field:change");
}
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/wysihat/events/selection_change.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ document.on("dom:loaded", function() {

var selectionChangeHandler = function() {
var element = document.activeElement;
var elementTagName = element.tagName.toLowerCase();
var elementTagName = element.tagName ? element.tagName.toLowerCase() : null;

if (elementTagName == "textarea" || elementTagName == "input") {
previousRange = null;
Expand Down
6 changes: 5 additions & 1 deletion src/wysihat/toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,12 @@ WysiHat.Toolbar = Class.create((function() {
* Bind handler to elements onclick event.
**/
function observeButtonClick(element, handler) {
element.on('click', function(event) {
element.on('mousedown', function(event) {
event.stop();
handler(this.editor);
}.bind(this));

element.on('click', function(event) {
event.stop();
}.bind(this));
}
Expand Down