{:uriI"file:///Library/WebServer/Documents/work/fine/_fae/app/assets/javascripts/fae/form/_cancel.js?type=application/javascript&pipeline=self&id=aceeb8324cf8ed394ac5271ab613ddd052cd94ab7f3a6031288778e8b60c290e:ET:load_pathI"G/Library/WebServer/Documents/work/fine/_fae/app/assets/javascripts;F: filenameI"[/Library/WebServer/Documents/work/fine/_fae/app/assets/javascripts/fae/form/_cancel.js;T: nameI"fae/form/_cancel;T:logical_pathI"fae/form/_cancel.self.js;T:content_typeI"application/javascript;T: sourceI"/* global Fae */ /** * Fae form cancel * @namespace form.cancel * @memberof form */ Fae.form.cancel = { init: function() { this.detectCancelledUrls(); this.addCancelParam(); }, /** * If URL has cancelled param, update the history */ detectCancelledUrls: function() { var params = window.location.search; if (params.length && params.toLowerCase().indexOf("cancelled") >= 0 && params.indexOf("&") !== 0) { window.history.replaceState(null, null, window.location.pathname); }; }, /** * Once any field changes, add cancelled param to button to ensure user knows data will be lost */ addCancelParam: function() { function updateCancel() { var $cancel_btn = $('#js-header-cancel'); var new_href = $cancel_btn.attr('href') + '?cancelled=true'; $cancel_btn.attr('href', new_href); $('form').off('change', 'input, textarea, select', updateCancel); } $('form').on('change', 'input, textarea, select', updateCancel); } }; ;T: metadata{ :dependencieso:Set: @hash} I"environment-version;TTI"environment-paths;TTI"Zprocessors:type=application/javascript&file_type=application/javascript&pipeline=self;TTI"ifile-digest:///Library/WebServer/Documents/work/fine/_fae/app/assets/javascripts/fae/form/_cancel.js;TTF: requiredo;;}F: stubbedo;;}F: linkso;;}F: charsetI" utf-8;F: digest"%%'\kmp?']7sWk: lengthi:integrityI"Xni:///sha-256;ihglj_6QJwFcpRbF_-T4tGttcH8_0yddqzfoc1dr77c?ct=application/javascript;T:dependencies_digest"%v9Ϧ=ȹ&O|w@&  .Q:idI"Eaceeb8324cf8ed394ac5271ab613ddd052cd94ab7f3a6031288778e8b60c290e;F: mtimel+BlRW