// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors // MIT License. See license.txt wn.ui.form.States = Class.extend({ init: function(opts) { $.extend(this, opts); this.state_fieldname = wn.workflow.get_state_fieldname(this.frm.doctype); // no workflow? if(!this.state_fieldname) return; this.update_fields = wn.workflow.get_update_fields(this.frm.doctype); var me = this; $(this.frm.wrapper).bind("render_complete", function() { me.refresh(); }) }, make: function() { this.parent = this.frm.appframe.parent .find(".workflow-button-area") .empty() .removeClass("hide"); this.workflow_button = $('') .appendTo(this.parent).dropdown(); this.dropdown = $('