dropdown.blade.php 1007 B

1234567891011121314151617181920212223242526272829
  1. @if(! empty($button['text']) || $click)
  2. <span class="drop{{ $direction }}" style="display:inline-block">
  3. <a id="{{ $buttonId }}" class="dropdown-toggle {{ $button['class'] }}" style="{{ $button['style'] }}" data-toggle="dropdown" href="javascript:void(0)">
  4. <stub>{!! $button['text'] !!}</stub>
  5. <span class="caret"></span>
  6. </a>
  7. <ul class="dropdown-menu">{!! $options !!}</ul>
  8. </span>
  9. @else
  10. <ul class="dropdown-menu">{!! $options !!}</ul>
  11. @endif
  12. @if($click)
  13. <script>
  14. var $btn = $('#{{ $buttonId }}'),
  15. $a = $btn.parent().find('ul li a'),
  16. text = String($btn.text());
  17. $a.on('click', function () {
  18. $btn.find('stub').html($(this).html() + ' &nbsp;');
  19. });
  20. if (text.replace(/(^\s*)|(\s*$)/g,"")) {
  21. $btn.find('stub').html(text + ' &nbsp;');
  22. } else {
  23. (!$a.length) || $btn.find('stub').html($($a[0]).html() + ' &nbsp;');
  24. }
  25. </script>
  26. @endif