Ahora las imagenes se refrescan automaticamente cuando se cambian

This commit is contained in:
Juan Ferrer Toribio 2015-09-04 10:50:06 +02:00
parent 2a433ac80f
commit 1d50d7b874
5 changed files with 19 additions and 15 deletions

2
debian/changelog vendored
View File

@ -1,4 +1,4 @@
hedera-web (1.212-deb8) stable; urgency=low hedera-web (1.213-deb8) stable; urgency=low
* Initial Release. * Initial Release.

View File

@ -4,6 +4,6 @@
} }
.packages .box .packages .box
{ {
max-width: 50em; max-width: 40em;
margin: 0 auto; margin: 0 auto;
} }

View File

@ -4,6 +4,6 @@
} }
.provinces .box .provinces .box
{ {
max-width: 50em; max-width: 40em;
margin: 0 auto; margin: 0 auto;
} }

View File

@ -83,9 +83,10 @@ Htk.ColumnImage = new Class
,value: this.value ,value: this.value
,tr: tr ,tr: tr
,error: false ,error: false
,stamp: null
}; };
this.setSrc (cell, true); this.setSrc (cell);
if (this.showFull) if (this.showFull)
{ {
@ -102,7 +103,7 @@ Htk.ColumnImage = new Class
return td; return td;
} }
,setSrc: function (cell, useCache) ,setSrc: function (cell)
{ {
if (cell.value) if (cell.value)
{ {
@ -113,8 +114,8 @@ Htk.ColumnImage = new Class
url += cell.value; url += cell.value;
if (!useCache) if (cell.stamp)
url += '?'+ new Date ().getTime (); url += '?'+ cell.stamp;
cell.img.src = url; cell.img.src = url;
} }
@ -133,10 +134,14 @@ Htk.ColumnImage = new Class
,onMouseOver: function (cell) ,onMouseOver: function (cell)
{ {
var fullDir = this._fullDir ? this._fullDir : 'full'; var src = this._fullDir ? this._fullDir : 'full';
src += '/'+ cell.value;
if (cell.stamp)
src += '?'+ cell.stamp;
if (!cell.error) if (!cell.error)
this.fullImage.show (this.basedir +'/'+ fullDir, cell.value); this.fullImage.show (this.basedir +'/'+ src);
} }
,onMouseOut: function () ,onMouseOut: function ()
@ -166,13 +171,14 @@ Htk.ColumnImage = new Class
,onNameChange: function (cell, editor, value) ,onNameChange: function (cell, editor, value)
{ {
cell.value = value; cell.value = value;
this.setSrc (cell, true); this.setSrc (cell);
this.changed (cell.tr, value); this.changed (cell.tr, value);
} }
,onFileUpload: function (cell, editor) ,onFileUpload: function (cell, editor)
{ {
this.setSrc (cell, false); cell.stamp = new Date ().getTime ();
this.setSrc (cell);
this.popup.hide (); this.popup.hide ();
} }

View File

@ -42,10 +42,8 @@ Htk.FullImage = new Class
return parseInt (Vn.Browser.getPageYOffset () + (Vn.Browser.getInnerHeight () - height) / 2) +'px'; return parseInt (Vn.Browser.getPageYOffset () + (Vn.Browser.getInnerHeight () - height) / 2) +'px';
} }
,show: function (basedir, file) ,show: function (src)
{ {
var src = basedir +'/'+ file;
if (this.closed && this.src == src) if (this.closed && this.src == src)
return; return;