fnp
/
redakcja.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Przyspieszenie dziaĆania operatora in na vstorage.
[redakcja.git]
/
platforma
/
static
/
js
/
main.js
diff --git
a/platforma/static/js/main.js
b/platforma/static/js/main.js
index
ddbe756
..
a49cb6a
100644
(file)
--- a/
platforma/static/js/main.js
+++ b/
platforma/static/js/main.js
@@
-1,5
+1,5
@@
-if (!console) {
- console = {
+if (!
window.
console) {
+
window.
console = {
log: function() {}
}
}
log: function() {}
}
}
@@
-64,7
+64,6
@@
function gallery(element, url) {
var pn = $('.page-number', element);
pn.change(function(event) {
var pn = $('.page-number', element);
pn.change(function(event) {
- console.log('change!', $(this).val());
event.preventDefault();
var n = normalizeNumber(pn.val());
pn.val(n);
event.preventDefault();
var n = normalizeNumber(pn.val());
pn.val(n);
@@
-94,7
+93,7
@@
function gallery(element, url) {
zoom();
});
$('.change-gallery', element).click(function() {
zoom();
});
$('.change-gallery', element).click(function() {
- $('.chosen-gallery').val($('#document-meta .gallery').html() ||
STATIC_URL + '
gallery/');
+ $('.chosen-gallery').val($('#document-meta .gallery').html() ||
'/platforma/
gallery/');
$('.gallery-image').animate({top: 53}, 200);
$('.chosen-gallery').focus();
});
$('.gallery-image').animate({top: 53}, 200);
$('.chosen-gallery').focus();
});
@@
-120,7
+119,10
@@
function gallery(element, url) {
galleryWidth: $(this).parent().width(),
galleryHeight: $(this).parent().height()
};
galleryWidth: $(this).parent().width(),
galleryHeight: $(this).parent().height()
};
- console.log('load', imageDimensions)
+
+ if (!(imageDimensions.width && imageDimensions.height)) {
+ setTimeout(function() { $('img', element).load(); }, 100);
+ }
var position = normalizePosition(
image.position().left,
image.position().top,
var position = normalizePosition(
image.position().left,
image.position().top,
@@
-182,7
+184,6
@@
function gallery(element, url) {
imageDimensions.width,
imageDimensions.height
);
imageDimensions.width,
imageDimensions.height
);
- console.log(image.position(), imageDimensions, position);
image.css({width: imageDimensions.width, height: imageDimensions.height,
left: position.x, top: position.y});
image.css({width: imageDimensions.width, height: imageDimensions.height,
left: position.x, top: position.y});
@@
-361,8
+362,8
@@
$(function() {
CodeMirror.fromTextArea('id_text', {
parserfile: 'parsexml.js',
CodeMirror.fromTextArea('id_text', {
parserfile: 'parsexml.js',
- path:
"/static/
js/lib/codemirror/",
- stylesheet:
"/static/
css/xmlcolors.css",
+ path:
STATIC_URL + "
js/lib/codemirror/",
+ stylesheet:
STATIC_URL + "
css/xmlcolors.css",
parserConfig: {
useHTMLKludges: false
},
parserConfig: {
useHTMLKludges: false
},