 $ = window.jQuery
 
 # CLASS
-class QtySelector:
+class QtySelector
 	constructor: (element, productId, qty = 1, options) ->
 		@element = element
 		@productId = productId

		@element.html $template

	bindEvents: =>
		@window.on 'vtex.qty.changed', @qtyChanged
		@element.find('.menos').on 'click', @decrementQty
		@element.find('.mais').on 'click', @incrementQty



	new QtySelector(this, productId, qty, options)

	# Chaining
	return this

# PLUGIN DEFAULTS
$.fn.qtySelector.defaults =
	readonly: true
	max: 999

# PLUGIN SHARED
$.qtySelector =
	template: """
						<div class="quantidade" style="display: block;">
						<p class="txtQuantidade">Selecione a quantidade:</p>
						<a href="#" class="menos">-</a>
						<input type="text" class="produtoQuantidade">
						<a href="#" class="mais">+</a>
						</div>
						"""