commit 6b83029f3d9514ffd723712098c653fb25acacee
parent 3aa0ac932aaba92e44c93fba350ca93eb05c837b
Author: Felicitus <felicitus@felicitus.org>
Date: Thu, 30 Jun 2011 18:05:52 +0200
Fixed issue #71
Diffstat:
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/frontend/js/Components/Part/PartDisplay.js b/frontend/js/Components/Part/PartDisplay.js
@@ -124,7 +124,7 @@ Ext.define('PartKeepr.PartDisplay', {
* Prompt the user for the stock level he wishes to add.
*/
addPartPrompt: function () {
- var j = new PartKeepr.PartStockWindow();
+ var j = new PartKeepr.PartStockWindow({ partUnitName: this.record.get("partUnitName") });
j.addStock(this.addPartHandler, this);
},
/**
@@ -144,7 +144,7 @@ Ext.define('PartKeepr.PartDisplay', {
* Prompts the user for the stock level to decrease for the item.
*/
deletePartPrompt: function () {
- var j = new PartKeepr.PartStockWindow();
+ var j = new PartKeepr.PartStockWindow({ partUnitName: this.record.get("partUnitName") });
j.removeStock(this.deletePartHandler, this);
},
/**
diff --git a/frontend/js/Components/Part/PartStockWindow.js b/frontend/js/Components/Part/PartStockWindow.js
@@ -35,8 +35,7 @@ Ext.define('PartKeepr.PartStockWindow', {
this.quantityField = Ext.create("Ext.form.field.Number", {
value: 0, // The initial value is 0, to indicate that this is a number field
minValue: 1, // The minimum value is 1. That way we force the user to enter a value
- anchor: '100%',
- fieldLabel: i18n("Quantity"),
+ width: 100,
listeners: {
specialkey: {
fn: function(field, e){
@@ -77,7 +76,12 @@ Ext.define('PartKeepr.PartStockWindow', {
this.form = Ext.create("Ext.form.Panel", {
bodyStyle: 'background:#DFE8F6;',
border: false,
- items: [ this.quantityField, this.priceField, this.priceCheckbox ]
+ items: [{
+ xtype: 'fieldcontainer',
+ fieldLabel: i18n("Quantity"),
+ layout: 'hbox',
+ items: [ this.quantityField, { width: 75, xtype: 'displayfield', margin: "0 0 0 5", value: this.partUnitName }]
+ }, this.priceField, this.priceCheckbox ]
});
this.items = this.form;