// TODO: v4 refactor /** * @namespace WORKAREA.publishWithReleaseMenus */ WORKAREA.registerModule('publishWithReleaseMenus', (function () { 'use strict'; var newReleaseOptionTemplate = JST['workarea/admin/templates/new_release_option'], updateTitleAttribute = function (select) { var title = $('option:selected', select).text(); $(select).attr('title', title); }, switchRelease = function (select) { $.post(WORKAREA.routes.admin.releaseSessionPath(), { release_id: $(select).val() }).done(function () { $(select).tooltipster('close'); if ($(select).data('publishWithReleaseMenu') !== 'async') { window.location.reload(); } }); }, removeNewReleaseOption = function (select) { $('[data-new-release-option]', select).remove(); }, updateSelect = function (select, newRelease) { $(select).append(function () { return $('