|
@@ -11,19 +11,19 @@
|
|
|
@endif
|
|
|
|
|
|
@if($click)
|
|
|
-<script>
|
|
|
- var $btn = $('#{{ $buttonId }}'),
|
|
|
- $a = $btn.parent().find('ul li a'),
|
|
|
- text = $btn.text();
|
|
|
+ <script>
|
|
|
+ var $btn = $('#{{ $buttonId }}'),
|
|
|
+ $a = $btn.parent().find('ul li a'),
|
|
|
+ text = String($btn.text());
|
|
|
|
|
|
- $a.on('click', function () {
|
|
|
- $btn.find('stub').html($(this).html() + ' ');
|
|
|
- });
|
|
|
+ $a.on('click', function () {
|
|
|
+ $btn.find('stub').html($(this).html() + ' ');
|
|
|
+ });
|
|
|
|
|
|
- if (text) {
|
|
|
- $btn.find('stub').html(text + ' ');
|
|
|
- } else {
|
|
|
- (!$a.length) || $btn.find('stub').html($($a[0]).html() + ' ');
|
|
|
- }
|
|
|
-</script>
|
|
|
+ if (text.replace(/(^\s*)|(\s*$)/g,"")) {
|
|
|
+ $btn.find('stub').html(text + ' ');
|
|
|
+ } else {
|
|
|
+ (!$a.length) || $btn.find('stub').html($($a[0]).html() + ' ');
|
|
|
+ }
|
|
|
+ </script>
|
|
|
@endif
|