From: zuber Date: Fri, 15 Jan 2010 14:27:28 +0000 (+0100) Subject: Pokazywanie przypisów w odpowiednim miejscu i ustalenie dla nich minimalnych rozmiarów. X-Git-Url: https://git.mdrn.pl/redakcja.git/commitdiff_plain/f6f32b1eb24d0f79293edff7832d6e3a4e5de95f?hp=cf891d5c934a7d112f3c36ad82b256917a096fca Pokazywanie przypisów w odpowiednim miejscu i ustalenie dla nich minimalnych rozmiarów. --- diff --git a/platforma/static/css/html.css b/platforma/static/css/html.css index d64cd6ea..38075779 100755 --- a/platforma/static/css/html.css +++ b/platforma/static/css/html.css @@ -439,6 +439,7 @@ padding: 1px; z-index: 2000; + position: absolute; } .html-editarea textarea @@ -453,6 +454,7 @@ z-index: 0; font-size: 10pt; + position: relative; /* background-color: ivory;*/ } diff --git a/platforma/static/js/main.js b/platforma/static/js/main.js index 1a281c40..ef4e7992 100644 --- a/platforma/static/js/main.js +++ b/platforma/static/js/main.js @@ -317,10 +317,6 @@ function html(element) { xtype == 'motyw' || xtype == 'begin' || xtype == 'end') { return false; } - - // this is hopefully redundant - //if(! node.is('*.utwor *') ) - // return false; // don't allow themes inside annotations if( node.is('*[x-annotation-box] *') ) @@ -360,7 +356,7 @@ function html(element) { range.insertNode(tag[0]); xml2html({ - xml: ''+text+'', + xml: ''+text+' --- ', success: function(text) { tag.replaceWith(text); }, @@ -466,6 +462,11 @@ function html(element) { var w = $box.outerWidth(); var h = $box.innerHeight(); + if ($origin.is(".annotation-inline-box")) { + w = Math.max(w, 400); + h = Math.max(h, 60); + } + console.log('width:', w, 'height:', h); // start edition on this node @@ -476,9 +477,9 @@ function html(element) { top: y, width: w // right: 0 - }).appendTo($box[0].offsetParent || element).show(); + }).appendTo($box[0].offsetParent || $box.parent()).show(); - console.log($overlay, $box[0].offsetParent || element); + console.log($overlay, $box[0].offsetParent || $box.parent()); var serializer = new XMLSerializer();