Mercurial > hg > OKFNAnnotator
diff annotator_files/lib/editor.js @ 4:6979313586cf
new version of annotator.
author | casties |
---|---|
date | Mon, 27 Aug 2012 19:05:38 +0200 |
parents | 6356e78ccf5c |
children |
line wrap: on
line diff
--- a/annotator_files/lib/editor.js Thu Apr 05 19:37:27 2012 +0200 +++ b/annotator_files/lib/editor.js Mon Aug 27 19:05:38 2012 +0200 @@ -1,6 +1,7 @@ +// Generated by CoffeeScript 1.3.3 var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, - __hasProp = Object.prototype.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor; child.__super__ = parent.prototype; return child; }; + __hasProp = {}.hasOwnProperty, + __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; Annotator.Editor = (function(_super) { @@ -25,11 +26,17 @@ function Editor(options) { this.onCancelButtonMouseover = __bind(this.onCancelButtonMouseover, this); + this.processKeypress = __bind(this.processKeypress, this); + this.submit = __bind(this.submit, this); + this.load = __bind(this.load, this); + this.hide = __bind(this.hide, this); - this.show = __bind(this.show, this); Editor.__super__.constructor.call(this, $(this.html)[0], options); + + this.show = __bind(this.show, this); + Editor.__super__.constructor.call(this, $(this.html)[0], options); this.fields = []; this.annotation = {}; } @@ -189,8 +196,12 @@ directionY = editor.hasClass(classes.invert.y) ? 1 : -1; textarea.height(height + (diff.top * directionY)); textarea.width(width + (diff.left * directionX)); - if (textarea.outerHeight() !== height) mousedown.top = event.pageY; - if (textarea.outerWidth() !== width) mousedown.left = event.pageX; + if (textarea.outerHeight() !== height) { + mousedown.top = event.pageY; + } + if (textarea.outerWidth() !== width) { + mousedown.left = event.pageX; + } } else if (mousedown.element === controls[0]) { editor.css({ top: parseInt(editor.css('top'), 10) + diff.top,