angular-deckgrid.js
function Deckgrid (scope, element) {
            var self = this,
                watcher,
                mql;

            this.$$elem = element;
            this.$$watchers = [];

            this.$$scope = scope;
            this.$$scope.columns = [];

            //
            // The layout configuration will be parsed from
            // the pseudo "before element." There you have to save all
            // the column configurations.
            //
            this.$$scope.layout = this.$$getLayout();

            this.$$createColumns();

            //
            // Register model change.
            //
            watcher = this.$$scope.$watchCollection('model', this.$$onModelChange.bind(this));

            this.$$watchers.push(watcher);

            //
            // Register media query change events.
            //
            angular.forEach(self.$$getMediaQueries(), function onIteration (rule) {
                var handler = self.$$onMediaQueryChange.bind(self);

                function onDestroy () {
                    rule.removeListener(handler);
                }

                rule.addListener(handler);

                self.$$watchers.push(onDestroy);
            });
            
            mql = $window.matchMedia('(orientation: portrait)');
            mql.addListener(self.$$onMediaQueryChange.bind(self));

        }
function Deckgrid (scope, element) {
            var self = this,
                watcher,
                mql;

            this.$$elem = element;
            this.$$watchers = [];

            this.$$scope = scope;
            this.$$scope.columns = [];

            //
            // The layout configuration will be parsed from
            // the pseudo "before element." There you have to save all
            // the column configurations.
            //
            this.$$scope.layout = this.$$getLayout();

            this.$$createColumns();

            //
            // Register model change.
            //
            watcher = this.$$scope.$watchCollection('model', this.$$onModelChange.bind(this));

            this.$$watchers.push(watcher);

            //
            // Register media query change events.
            //
            angular.forEach(self.$$getMediaQueries(), function onIteration (rule) {
                var handler = self.$$onMediaQueryChange.bind(self);

                function onDestroy () {
                    rule.removeListener(handler);
                }

                rule.addListener(handler);

                self.$$watchers.push(onDestroy);
            });
            
            mql = $window.matchMedia('(orientation: portrait)');
            mql.addListener(self.$$onMediaQueryChange.bind(self));

        }
function Deckgrid ( scope , element ) { var self = this , watcher , mql ; this . $$elem = element ; this . $$watchers = [ ] ; this . $$scope = scope ; this . $$scope . columns = [ ] ; // // The layout configuration will be parsed from // the pseudo "before element." There you have to save all // the column configurations. // this . $$scope . layout = this . $$getLayout ( ) ; this . $$createColumns ( ) ; // // Register model change. // watcher = this . $$scope . $watchCollection ( 'model' , this . $$onModelChange . bind ( this ) ) ; this . $$watchers . push ( watcher ) ; // // Register media query change events. // angular . forEach ( self . $$getMediaQueries ( ) , function onIteration ( rule ) { var handler = self . $$onMediaQueryChange . bind ( self ) ; function onDestroy ( ) { rule . removeListener ( handler ) ; } rule . addListener ( handler ) ; self . $$watchers . push ( onDestroy ) ; } ) ; mql = $window . matchMedia ( '(orientation: portrait)' ) ; mql . addListener ( self . $$onMediaQueryChange . bind ( self ) ) ; }
The deckgrid directive.
The deckgrid directive .