X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/ffc2e047ca6712af8da3e13891b7ea16f184264a..ee77d43cb32edb0f8b838204e0583ab1a2757d3a:/redakcja/static/js/wiki_img/view_editor_objects.js
diff --git a/redakcja/static/js/wiki_img/view_editor_objects.js b/redakcja/static/js/wiki_img/view_editor_objects.js
index 97d4ba25..b0cf2a9d 100644
--- a/redakcja/static/js/wiki_img/view_editor_objects.js
+++ b/redakcja/static/js/wiki_img/view_editor_objects.js
@@ -7,8 +7,10 @@
options.callback = function(){
var self = this;
- self.$tag_name = $('#objects-editor #tag-name');
- self.$objects_list = $('#objects-editor #objects-list');
+ self.$tag_name = $('#objects-editor .tag-name');
+ self.$toolbar = $('#objects-editor .toolbar');
+ self.$scrolled = $('#objects-editor .scrolled');
+ self.$objects_list = $('#objects-editor .objects-list');
self.x1 = null;
self.x2 = null;
@@ -17,13 +19,14 @@
if (!CurrentDocument.readonly) {
self.ias = $('#objects-editor img.area-selectable').imgAreaSelect({ handles: true, onSelectEnd: self._fillCoords(self), instance: true });
- $('#objects-editor #add').click(self._addObject(self));
+ $('#objects-editor .add').click(self._addObject(self));
$('.delete', self.$objects_list).live('click', function() {
$(this).prev().trigger('click');
if (window.confirm("Czy na pewno chcesz usunÄ
Ä ten obiekt?")) {
$(this).prev().remove();
$(this).remove();
+ self._refreshLayout();
}
self._resetSelection();
return false;
@@ -61,6 +64,9 @@
self.ias.setOptions({ hide: true });
}
+ ObjectsPerspective.prototype._refreshLayout = function() {
+ this.$scrolled.css({top: this.$toolbar.height()});
+ };
ObjectsPerspective.prototype._push = function(name, x1, y1, x2, y2) {
var $e = $('')
@@ -68,7 +74,8 @@
if (x1 !== null)
$e.data('coords', [x1, y1, x2, y2]);
this.$objects_list.append($e);
- this.$objects_list.append('(x)');
+ this.$objects_list.append('(x) ');
+ this._refreshLayout();
}