From 684373ed7cf7006824dabd479b7cdd2e7ceb1b10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Sun, 16 Jul 2017 19:09:28 +0200 Subject: [PATCH] misc: fix label of wysiwyg popup dialogs (#17646) --- wcs/qommon/static/js/popup.js | 2 +- wcs/qommon/static/js/qommon.wysiwyg.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wcs/qommon/static/js/popup.js b/wcs/qommon/static/js/popup.js index 2098948c..feebabdc 100644 --- a/wcs/qommon/static/js/popup.js +++ b/wcs/qommon/static/js/popup.js @@ -12,7 +12,7 @@ function displayPopup(event) $(dialog).find('.buttons').hide(); $(html).find('.buttons input, .buttons button').each(function(idx, elem) { var button = Object(); - button.text = $(elem).val(); + button.text = $(elem).val() || $(elem).text(); var name = $(elem).prop('name'); if (name === 'cancel') { button.click = function() { $(this).dialog('close'); return false; }; diff --git a/wcs/qommon/static/js/qommon.wysiwyg.js b/wcs/qommon/static/js/qommon.wysiwyg.js index d61c8625..e152eb3a 100644 --- a/wcs/qommon/static/js/qommon.wysiwyg.js +++ b/wcs/qommon/static/js/qommon.wysiwyg.js @@ -32,8 +32,8 @@ $(document).ready( function() { $(html).find('textarea').appendTo(dialog); var title = $(html).find('label').text(); var ckname = $(html).find('textarea').attr('name'); - var submit = $(html).find('input[name="submit"]').val(); - var cancel = $(html).find('input[name="cancel"]').val(); + var submit = $(html).find('button[name="submit"]').text(); + var cancel = $(html).find('button[name="cancel"]').text(); $(dialog).dialog({ modal: true, resizable: false, -- 2.13.2