accurator/commit
More specific retrieval of deniche node in handlers.
author | Chris Dijkshoorn |
---|---|
Fri Apr 15 20:23:47 2016 +0200 | |
committer | Chris Dijkshoorn |
Fri Apr 15 20:23:47 2016 +0200 | |
commit | 91e2b80d8a261fc3c8d070e15fa621dcca63f7ea |
tree | 70fd8299c58bff58752212ebf6a3995e6b34b709 |
parent | d5e7249571865d3cd04ee065743d6a1db3887151 |
Diff style: patch stat
diff --git a/web/js/components/deniche-plugin.js b/web/js/components/deniche-plugin.js index 34a807a..eca743a 100644 --- a/web/js/components/deniche-plugin.js +++ b/web/js/components/deniche-plugin.js @@ -175,18 +175,18 @@ annotorious.plugin.DenichePlugin.prototype.installHandlers = function() { this._anno.addHandler('onEditorShown', function(annotation) { // get the annotorious save and cancel button so we can manipulate them: - var node = oSelf.annotator.element; + var node = $(oSelf.annotator.element); // store buttons, change labels and change styling - oSelf._saveButtons[annotation.fieldsId] = $(".annotorious-editor-button-save").get(0); + oSelf._saveButtons[annotation.fieldsId] = node.find(".annotorious-editor-button-save").get(0); oSelf._saveButtons[annotation.fieldsId].innerHTML = oSelf._labels.annoBtnDone; oSelf._saveButtons[annotation.fieldsId].className += " btn btn-primary btn-sm"; - oSelf._cancelButtons[annotation.fieldsId] = $(".annotorious-editor-button-cancel").get(0); + oSelf._cancelButtons[annotation.fieldsId] = node.find(".annotorious-editor-button-cancel").get(0); oSelf._cancelButtons[annotation.fieldsId].innerHTML = oSelf._labels.annoBtnCancel; oSelf._cancelButtons[annotation.fieldsId].className += " btn btn-default btn-sm"; // set focus on first field (exlude hint input field introduced by twitter typeahead) - $(".annotorious-editor input").not(".tt-hint")[0].focus(); + node.find(".annotorious-editor input").not(".tt-hint")[0].focus(); oSelf._dirtytag = null; if (annotation && annotation.shapes) { @@ -205,4 +205,6 @@ annotorious.plugin.DenichePlugin.prototype.installHandlers = function() { this._anno.addHandler('onAnnotationUpdated', function(original) { oSelf.flushDirtyAnnotation(original); }); + + // $(".annotorious-editor-button-save").get(0) }