Skip to content

Commit

Permalink
Fix for description textarea
Browse files Browse the repository at this point in the history
  • Loading branch information
hillelcoren committed Sep 18, 2016
1 parent ec963e0 commit 0d2b1f6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 54 deletions.
15 changes: 7 additions & 8 deletions resources/views/invoices/edit.blade.php
Expand Up @@ -262,8 +262,8 @@
</div>
</td>
<td>
<textarea data-bind="value: wrapped_notes, valueUpdate: 'afterkeydown', attr: {name: 'invoice_items[' + $index() + '][notes]'}"
rows="1" cols="60" style="resize: vertical" class="form-control word-wrap"></textarea>
<textarea data-bind="value: notes, valueUpdate: 'afterkeydown', attr: {name: 'invoice_items[' + $index() + '][notes]'}"
rows="1" cols="60" style="resize: vertical;height:42px" class="form-control word-wrap"></textarea>
<input type="text" data-bind="value: task_public_id, attr: {name: 'invoice_items[' + $index() + '][task_public_id]'}" style="display: none"/>
<input type="text" data-bind="value: expense_public_id, attr: {name: 'invoice_items[' + $index() + '][expense_public_id]'}" style="display: none"/>
</td>
Expand Down Expand Up @@ -340,11 +340,11 @@

<div class="tab-content">
<div role="tabpanel" class="tab-pane active" id="notes" style="padding-bottom:44px">
{!! Former::textarea('public_notes')->data_bind("value: wrapped_notes, valueUpdate: 'afterkeydown'")
{!! Former::textarea('public_notes')->data_bind("value: public_notes, valueUpdate: 'afterkeydown'")
->label(null)->style('resize: none; width: 500px;')->rows(4) !!}
</div>
<div role="tabpanel" class="tab-pane" id="terms">
{!! Former::textarea('terms')->data_bind("value:wrapped_terms, placeholder: terms_placeholder, valueUpdate: 'afterkeydown'")
{!! Former::textarea('terms')->data_bind("value:terms, placeholder: terms_placeholder, valueUpdate: 'afterkeydown'")
->label(false)->style('resize: none; width: 500px')->rows(4)
->help('<div class="checkbox">
<label>
Expand All @@ -356,7 +356,7 @@
</div>') !!}
</div>
<div role="tabpanel" class="tab-pane" id="footer">
{!! Former::textarea('invoice_footer')->data_bind("value:wrapped_footer, placeholder: footer_placeholder, valueUpdate: 'afterkeydown'")
{!! Former::textarea('invoice_footer')->data_bind("value:invoice_footer, placeholder: footer_placeholder, valueUpdate: 'afterkeydown'")
->label(false)->style('resize: none; width: 500px')->rows(4)
->help('<div class="checkbox">
<label>
Expand Down Expand Up @@ -1108,10 +1108,9 @@ function applyComboboxListeners() {
});
$('textarea').on('keyup focus', function(e) {
while($(this).outerHeight() < this.scrollHeight + parseFloat($(this).css("borderTopWidth")) + parseFloat($(this).css("borderBottomWidth"))) {
$(this).height($(this).height()+1);
};
$(this).height(0).height(this.scrollHeight-18);
});
}
function createInvoiceModel() {
Expand Down
46 changes: 0 additions & 46 deletions resources/views/invoices/knockout.blade.php
Expand Up @@ -296,40 +296,6 @@ function InvoiceModel(data) {
}
})
self.wrapped_terms = ko.computed({
read: function() {
return this.terms();
},
write: function(value) {
value = wordWrapText(value, 300);
self.terms(value);
},
owner: this
});
self.wrapped_notes = ko.computed({
read: function() {
return this.public_notes();
},
write: function(value) {
value = wordWrapText(value, 300);
self.public_notes(value);
},
owner: this
});
self.wrapped_footer = ko.computed({
read: function() {
return this.invoice_footer();
},
write: function(value) {
value = wordWrapText(value, 600);
self.invoice_footer(value);
},
owner: this
});
self.removeItem = function(item) {
self.invoice_items.remove(item);
refreshPDF(true);
Expand Down Expand Up @@ -745,18 +711,6 @@ function ItemModel(data) {
ko.mapping.fromJS(data, {}, this);
}
self.wrapped_notes = ko.computed({
read: function() {
return this.notes();
},
write: function(value) {
//value = wordWrapText(value, 235);
self.notes(value);
//onItemChange();
},
owner: this
});
this.totals = ko.observable();
this.totals.rawTotal = ko.computed(function() {
Expand Down

0 comments on commit 0d2b1f6

Please sign in to comment.