question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add Expand (fullscreen) / Compress box-widget

See original GitHub issue

Hi,

I added this widget to my website and it works great, I think this could be a nice small addition to the project 😉

widgets

I’m not doing a pull request since my way of doing it may not be the best.

boxWidgetOptions: {
      boxWidgetIcons: {
        //The icon that triggers the collapse event
        collapse: 'fa fa-minus',
        //The icon that trigger the opening event
        open: 'fa fa-plus',
        //The icon that triggers the removing event
        remove: 'fa fa-times',
        //The icon that triggers the maximize event
        maximize: 'fa fa-expand'
      },
      boxWidgetSelectors: {
        //Remove button selector
        remove: '[data-widget="remove"]',
        //Collapse button selector
        collapse: '[data-widget="collapse"]',
        //Expand button selector
        maximize: '[data-widget="maximize"]'
      }
    },
//Listen for maximize event triggers
        $(o.boxWidgetOptions.boxWidgetSelectors.maximize).click(function (e) {
          e.preventDefault();
          _this.maximize($(this));
        });
maximize: function (element) {
        function maximizer(n) {
          if (n) {
            var t = $(window).height(),
                i = n.find(".box-header").height();
                n.find(".box-body").height(t - i)
          }
        }
        var t = element.parents(".box").first(),
            i = element.find("i").first(),
            r = "fa-compress",
            u = "fa-expand";
        t.hasClass("maximized") ? (i && i.addClass(u).removeClass(r), t.removeClass("maximized"), t.find(".box-body").css("height", "auto")) : (i && i.addClass(r).removeClass(u), t.addClass("maximized"), maximizer(t))
      }
.maximized {
    z-index: 9999;
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
}

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:15 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
adaniellocommented, Apr 10, 2015

👍

Thanks for sharing

0reactions
REJackcommented, Jun 17, 2019

I‘ll create soon the v3.0.0-beta.1 release and publish it on npmjs and packagist.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Enable Expanded Widgets Full-Screen View in ...
Microsoft has introduced a Full-Screen ( Expanded ) Widgets panel in Windows 11 build 25201. The purpose of making this change is to...
Read more >
Card Widget Plugin | AdminLTE 3 Documentation
The card widget plugin provides the functionality for collapsing, expanding and removing a card. Usage. This plugin can be activated as a jQuery...
Read more >
Flutter Sized Box & Fitted Box Widget with Example - Developine
Hello there! Let us first explore Flutter Sized Box Widget. Sized Box Widget Explained. In many cases you know exactly how much space...
Read more >
Expand and Collapse Widgets Board View in Windows 11
Click/tap on the Expand button at the top right to expand the widgets board to full screen. Click/tap on the Collapse button at...
Read more >
Sitefinity How-tos for UTMB websites
See the various layout templates for the Feature Box widget component. Create a Feature Collection. How to. Expand All Collapse All. Create a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found