X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/d6d7788c4e6b1d3da88833329b326fd7a3891503..58be2f1c488248d11dfb2ad730b6a8d56e557e63:/apps/workbench/app/assets/javascripts/editable.js diff --git a/apps/workbench/app/assets/javascripts/editable.js b/apps/workbench/app/assets/javascripts/editable.js index 76a129b2bf..939506c2ec 100644 --- a/apps/workbench/app/assets/javascripts/editable.js +++ b/apps/workbench/app/assets/javascripts/editable.js @@ -1,3 +1,7 @@ +// Copyright (C) The Arvados Authors. All rights reserved. +// +// SPDX-License-Identifier: AGPL-3.0 + $.fn.editable.defaults.ajaxOptions = {type: 'post', dataType: 'json'}; $.fn.editable.defaults.send = 'always'; @@ -55,6 +59,12 @@ $(document). if (response.href) { $(this).editable('option', 'url', response.href); } + if ($(this).attr('data-name')) { + var textileAttr = $(this).attr('data-name') + 'Textile'; + if (response[textileAttr]) { + $(this).attr('data-textile', response[textileAttr]); + } + } return; }, error: function(response, newValue) { @@ -75,6 +85,10 @@ $(document). // information if it appears elsewhere on the page. if (reason != 'save') return; var html = $(this).html(); + if( $(this).attr('data-textile') ) { + html = $(this).attr('data-textile'); + $(this).html(html); + } var uuid = $(this).attr('data-object-uuid'); var attr = $(this).attr('data-name'); var edited = this;