ManifestWebDesign / angular-gridster

An implementation of gridster-like widgets for Angular JS
http://manifestwebdesign.github.io/angular-gridster/
MIT License
964 stars 394 forks source link

Breaking issues in updating to v0.13.12 #433

Closed marcusmotill closed 8 years ago

marcusmotill commented 8 years ago

After updating to v0.13.12 from v0.13.9 I got the following error: image

And the grid items were no longer "Gridster-esque" they had bullet points and listed down vertically.

Here is my HTML code:

<div gridster="gridOpts">
        <ul>
            <li data-gridster-item data-sizex="card.size.x" data-sizey="card.size.y" data-row="card.position[0]"
                data-col="card.position[1]"
                ng-repeat="card in cards track by card.name + $index">
                <div style="height: 100%;">
                    <section ng-switch on="card.type" style="height: 100%;">
                        <card-setup ng-switch-when="setup"></card-setup>
                        <card-boards ng-switch-when="boards"></card-boards>
                        <!-- A lot more cards below this -->
                    </section>
                </div>
            </li>
        </ul>
    </div>

Here are my gridOpts:

$scope.gridOpts = {
            draggable: {
                handle: '.card-header'
            },
            swapping: true,
            outerMargin: false,
            resizable: {
                enabled: true,
                handles: ['e', 's', 'w', 'se', 'sw']
            }
        };

        getGridOpts();

        function getGridOpts() {
            var layout = _.get($scope.panel, 'layout', 'vertical');

            if (layout == 'horizontal') {
                $scope.gridOpts.maxRows = 6;
                $scope.gridOpts.columns = $scope.cards.length + 1;
                $scope.gridOpts.colWidth = '370';

            } else {
                $scope.gridOpts.columns = 12;
            }
        }

Sample card item:

{  
    "name":"recentMail",
    "title":"Mail",
    "size":{  
        "x":6,
        "y":4
    },
    "type":"topContent",
    "properties":{  
        // content rendered
    }
}

Let me know if you need anymore information, thanks

danomatic commented 8 years ago

Please try pointing your bower.json to the "master" and let me know if that solves the error. Also, the latest version does point to the .less file instead of the .css file, so you may have to update your build script accordingly to get styles.

marcusmotill commented 8 years ago

Probably the latter of the two, I don't do anything with less in my build. Will try tonight/tomorrow and let you know thanks for the quick reply!

On Tue, Jul 19, 2016, 3:41 PM Dan Blaisdell notifications@github.com wrote:

Please try point your bower.json to the "master" and let me know if that solves the error. Also, the latest version does point to the .less file instead of the .css file, so you may have to update your build script accordingly to get styles.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ManifestWebDesign/angular-gridster/issues/433#issuecomment-233758759, or mute the thread https://github.com/notifications/unsubscribe-auth/AHUVEil8Plkuai_0G-clQ6fDzC4c6WkYks5qXTZdgaJpZM4JQFAt .

mtraynham commented 8 years ago

@danomatic Curious why you decided to change bower to point at the less file. Tools like wiredep, which is a bower bundler look at these main files and automatigically wires them up into the html page or minify thems into a single build, but it doesn't perform transformations like Webpack would. Honestly, I'm not sure why people mark non-browser deployables in the bower main field, but even Bootstrap does this...

brianpkelley commented 8 years ago

I agree with @danomatic even though I'm using less quite extensively in my project(s) I don't see why a project would specify a less file as the main deployable.

danomatic commented 8 years ago

The change was actually unintentional and came with a PR. The author of the PR was fixing a warning about having "main" point to minified CSS. Latest release will address this by pointing to non-minified CSS in the dist directory.