'use strict';

(function() {
  angular.module('ngJScrollPane', []);

  angular.module('ngJScrollPane').directive('scrollPane', [
    '$timeout',
    function($timeout) {
      return {
        restrict: 'A',
        transclude: true,
        template: '<div class="scroll-pane"><div ng-transclude class="scroll-container" style="height : 300px !important"></div></div>',
        link: function($scope, $elem, $attrs) {
          var cal_width;
          var config, fn;
          config = {};
          $scope.$on('albumCompleteEvent', function(event, args) {
            console.log(args.albumLength + 'shi');
            cal_width = (args.albumLength * 420) + 'px';
            $('.scroll-container').css('width', cal_width);
            console.log('s' + $elem.children().width());
            if ($attrs.scrollConfig) {
              config = $scope.$eval($attrs.scrollConfig);
            }
            fn = function() {
              return jQuery('#' + $attrs.id).jScrollPane(config);
            };
            if ($attrs.scrollTimeout) {
              return $timeout(fn, $scope.$eval($attrs.scrollTimeout));
            } else {
              return fn();
            }
          });
        },
        replace: true
      };
    }
  ]);

}).call(this);

@@ -318,42 +318,8 @@
 ner%22
- style=%22height : 300px !important%22
 %3E%3C/d
@@ -330,16 +330,16 @@
 /div%3E',%0A
+
         
@@ -523,59 +523,9 @@
 ) %7B%0A
-            console.log(args.albumLength + 'shi');
 %0A
+
     
@@ -641,65 +641,8 @@
 h);%0A
-            console.log('s' + $elem.children().width());%0A
     
@@ -1024,32 +1024,32 @@
 ;%0A            %7D%0A
-
           %7D);%0A  
@@ -1046,16 +1046,463 @@
     %7D);%0A
+          if ($attrs.directInitiate) %7B%0A            if ($attrs.scrollConfig) %7B%0A              config = $scope.$eval($attrs.scrollConfig);%0A            %7D%0A            fn = function() %7B%0A              return jQuery('#' + $attrs.id).jScrollPane(config);%0A            %7D;c%0A            if ($attrs.scrollTimeout) %7B%0A              return $timeout(fn, $scope.$eval($attrs.scrollTimeout));%0A            %7D else %7B%0A              return fn();%0A            %7D%0A          %7D%0A
         

Update angular-jscrollpane.js