Sha256: cb27acc3e299858dced4970caf3b5316aa07149a5b5ab63d2bbd44f50808d4f8

Contents?: true

Size: 406 Bytes

Versions: 5

Compression:

Stored size: 406 Bytes

Contents

import { Controller } from '@hotwired/stimulus'

export default class extends Controller {
  static values = {
    initialCountOnHand: Number,
  }

  static targets = ['countOnHand', 'quantityAdjustment']

  connect() {
    this.updateCountOnHand()
  }

  updateCountOnHand() {
    this.countOnHandTarget.value = parseInt(this.initialCountOnHandValue) + parseInt(this.quantityAdjustmentTarget.value)
  }
}

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
solidus_admin-0.3.2 app/components/solidus_admin/stock_items/edit/component.js
solidus_admin-0.3.1 app/components/solidus_admin/stock_items/edit/component.js
solidus_admin-0.3.0 app/components/solidus_admin/stock_items/edit/component.js
solidus_admin-0.2.0 app/components/solidus_admin/stock_items/edit/component.js
solidus_admin-0.1.0 app/components/solidus_admin/stock_items/edit/component.js