Loader, bugs solved

This commit is contained in:
Juan Ferrer Toribio 2018-01-16 17:26:37 +01:00
parent a6af942424
commit 66644104de
8 changed files with 99 additions and 14 deletions

2
debian/changelog vendored
View File

@ -1,4 +1,4 @@
hedera-web (1.405.66) stable; urgency=low
hedera-web (1.405.67) stable; urgency=low
* Initial Release.

View File

@ -26,7 +26,7 @@
</div>
<div id="form" class="ticket">
<div class="box">
<div class="head">
<htk-loader class="head" form="ticket">
<div>
<p class="important ticket-id">
@<htk-text column="id" form="ticket"/>
@ -61,7 +61,7 @@
<htk-text format="%.2d€" form="ticket" column="total"/>
</p>
</div>
</div>
</htk-loader>
<htk-repeater form-id="iter" renderer="repeaterFunc">
<db-model
property="model"

View File

@ -6,4 +6,3 @@ require_once 'vn-autoload.php';
$cliApp = new Vn\Lib\CliApp ('hedera-web', __DIR__.'/rest');
$cliApp->run ();

View File

@ -17,6 +17,7 @@ Htk = module.exports = {
,ImageEditor : require ('./image-editor')
,Assistant : require ('./assistant')
,AssistantBar : require ('./assistant-bar')
,Loader : require ('./loader')
,Field : require ('./field')
,Column : require ('./column')
};

79
js/htk/loader.js Normal file
View File

@ -0,0 +1,79 @@
var Widget = require ('./widget');
module.exports = new Class
({
Tag: 'htk-loader'
,Extends: Widget
,Properties: {
form:
{
type: Db.Form
,set: function (x)
{
this.link ({_form: x}, {'status-changed': this.onFormChange});
this.onFormChange ();
}
,get: function ()
{
return this._form;
}
}
}
,initialize: function ()
{
var node = this.createRoot ('div');
node.className = 'htk-loader';
var div = this.createElement ('div');
div.className = 'spinner';
var spinner = new Htk.Spinner ();
div.appendChild (spinner.node);
var childs = this.createElement ('div');
this.spinner = spinner;
this.div = div;
this.childs = childs;
this.isLoading = true;
this.stop ();
}
,appendChild: function (child)
{
this.childs.appendChild (child);
}
,stop: function ()
{
if (!this.isLoading)
return;
this.isLoading = false;
this.spinner.stop ();
Vn.Node.removeChilds (this.node);
this.node.appendChild (this.childs);
}
,start: function ()
{
if (this.isLoading)
return;
this.isLoading = true;
this.spinner.start ();
Vn.Node.removeChilds (this.node);
this.node.appendChild (this.div);
}
,onFormChange: function ()
{
if (this._form.ready)
this.stop ();
else
this.start ();
}
});

View File

@ -593,7 +593,7 @@ td.cell-image .htk-image
background-color: initial;
}
/* Loader */
/* Spinner */
.htk-spinner
{
@ -630,3 +630,9 @@ td.cell-image .htk-image
to {-webkit-transform: rotate(360deg);}
}
/* Loader */
.htk-loader > .spinner
{
text-align: center;
}

View File

@ -3,17 +3,17 @@ vnCustomTags = {};
var Mutators = Class.Mutators;
var _Extends = Mutators.Extends;
Mutators.Extends = function ()
{
_Extends.apply (this, arguments);
this.implement ({Properties: {}});
}
Mutators.Tag = function (tagName)
{
vnCustomTags[tagName] = this;
if (this.parent)
{
this.implement ({Parent: this.parent.Parent});
this.implement ({Child: this.parent.Child});
this.implement ({Properties: {}});
}
this.extend ({Tag: tagName});
};

View File

@ -1,6 +1,6 @@
{
"name": "hedera-web",
"version": "1.405.66",
"version": "1.405.67",
"description": "Verdnatura web page",
"license": "GPL-3.0",
"repository": {