mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-19 06:54:19 +01:00
Payment Request: Improve public view (#5413)
* Payment Request: Improve public view Closes #4450. * Test fix * Extract Vue utils * Improve payment history * Fix amount display * Unify receipt and payment request tables * Re-add text confirmation for copying to clipboard * Minor print optimizations * Wording: Rename Description to Memo * Open view links in new window * View updates
This commit is contained in:
37
BTCPayServer/wwwroot/js/vue-utils.js
Normal file
37
BTCPayServer/wwwroot/js/vue-utils.js
Normal file
@@ -0,0 +1,37 @@
|
||||
Vue.directive('collapsible', {
|
||||
bind: function (el, binding) {
|
||||
el.classList.add('collapse');
|
||||
el.classList[binding.value ? 'add' : 'remove']('show');
|
||||
el.transitionDuration = 350;
|
||||
},
|
||||
update: function (el, binding) {
|
||||
if (binding.oldValue !== binding.value){
|
||||
if (binding.value) {
|
||||
setTimeout(function () {
|
||||
el.classList.remove('collapse');
|
||||
const height = window.getComputedStyle(el).height;
|
||||
el.classList.add('collapsing');
|
||||
el.offsetHeight;
|
||||
el.style.height = height;
|
||||
setTimeout(function () {
|
||||
el.classList.remove('collapsing');
|
||||
el.classList.add('collapse');
|
||||
el.style.height = null;
|
||||
el.classList.add('show');
|
||||
}, el.transitionDuration)
|
||||
}, 0);
|
||||
} else {
|
||||
el.style.height = window.getComputedStyle(el).height;
|
||||
el.classList.remove('collapse');
|
||||
el.classList.remove('show');
|
||||
el.offsetHeight;
|
||||
el.style.height = null;
|
||||
el.classList.add('collapsing');
|
||||
setTimeout(function () {
|
||||
el.classList.add('collapse');
|
||||
el.classList.remove('collapsing');
|
||||
}, el.transitionDuration)
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user