Skip to content

Commit

Permalink
Merge pull request #54 from pedroabreu/refactor
Browse files Browse the repository at this point in the history
Refactor
  • Loading branch information
pedroabreu committed Mar 26, 2016
2 parents 82ec271 + 9032397 commit bc9837d
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 56 deletions.
14 changes: 3 additions & 11 deletions dist/ion-gallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,6 @@
col = 0;
}

if(!items[i].hasOwnProperty('sub')){
items[i].sub = '';
}

if(!items[i].hasOwnProperty('thumb')){
items[i].thumb = items[i].src;
}

items[i].position = i;

_gallery[row][col] = items[i];
Expand Down Expand Up @@ -306,7 +298,7 @@
$scope.selectedSlide = 1;
$scope.hideAll = false;

$scope.showImage = function(index) {
$scope.openSlider = function(index) {
$scope.slides = [];
currentImage = index;

Expand Down Expand Up @@ -459,5 +451,5 @@
}
})();

angular.module("templates", []).run(["$templateCache", function($templateCache) {$templateCache.put("gallery.html","<div class=\"gallery-view\">\n <div class=\"row\" ng-repeat=\"item in items track by $index\" ion-row-height>\n <div ng-repeat=\"photo in item track by $index\"\n class=\"col col-{{responsiveGrid}} image-container\">\n\n <img ion-image-scale\n ng-src=\"{{photo.thumb}}\"\n ng-click=\"customCallback ? ionItemCallback({item:photo}) : showImage(photo.position)\">\n\n </div>\n </div>\n <div ion-slider></div>\n</div>\n");
$templateCache.put("slider.html","<ion-modal-view class=\"imageView\">\n <ion-header-bar class=\"headerView\" ng-show=\"!hideAll\">\n <button class=\"button button-outline button-light close-btn\" ng-click=\"closeModal()\">{{::actionLabel}}</button>\n </ion-header-bar>\n \n <ion-content class=\"has-no-header\" scroll=\"false\">\n <ion-slide-box does-continue=\"true\" active-slide=\"selectedSlide\" show-pager=\"false\" class=\"listContainer\" on-slide-changed=\"slideChanged($index)\">\n <ion-slide ng-repeat=\"single in slides track by $index\">\n <ion-scroll direction=\"xy\"\n locking=\"false\" \n zooming=\"true\"\n min-zoom=\"1\"\n scrollbar-x=\"false\"\n scrollbar-y=\"false\"\n ion-slide-action\n delegate-handle=\"slide-{{$index}}\"\n overflow-scroll=\"false\"\n >\n <div class=\"item item-image gallery-slide-view\">\n <img ng-src=\"{{single.src}}\">\n </div>\n <div ng-if=\"single.sub.length > 0\" class=\"image-subtitle\" ng-show=\"!hideAll\">\n <span ng-bind-html=\'single.sub\'></span>\n </div>\n </ion-scroll>\n </ion-slide>\n </ion-slide-box>\n </ion-content>\n</ion-modal-view>");}]);
angular.module("templates", []).run(["$templateCache", function($templateCache) {$templateCache.put("gallery.html","<div class=\"gallery-view\">\n <div class=\"row\" ng-repeat=\"item in items track by $index\" ion-row-height>\n <div ng-repeat=\"photo in item track by $index\"\n class=\"col col-{{responsiveGrid}} image-container\">\n\n <img ion-image-scale\n ng-src=\"{{photo.thumb || photo.src}}\"\n ng-click=\"customCallback ? ionItemCallback({item:photo}) : openSlider(photo.position)\">\n\n </div>\n </div>\n <div ion-slider></div>\n</div>\n");
$templateCache.put("slider.html","<ion-modal-view class=\"imageView\">\n <ion-header-bar class=\"headerView\" ng-show=\"!hideAll\">\n <button class=\"button button-outline button-light close-btn\" ng-click=\"closeModal()\">{{::actionLabel}}</button>\n </ion-header-bar>\n\n <ion-content class=\"has-no-header\" scroll=\"false\">\n <ion-slide-box does-continue=\"true\" active-slide=\"selectedSlide\" show-pager=\"false\" class=\"listContainer\" on-slide-changed=\"slideChanged($index)\">\n <ion-slide ng-repeat=\"single in slides track by $index\">\n <ion-scroll direction=\"xy\"\n locking=\"false\"\n zooming=\"true\"\n min-zoom=\"1\"\n scrollbar-x=\"false\"\n scrollbar-y=\"false\"\n ion-slide-action\n delegate-handle=\"slide-{{$index}}\"\n overflow-scroll=\"false\"\n >\n <div class=\"item item-image gallery-slide-view\">\n <img ng-src=\"{{single.src}}\">\n </div>\n <div ng-if=\"single.sub && single.sub.length > 0\" class=\"image-subtitle\" ng-show=\"!hideAll\">\n <span ng-bind-html=\'single.sub\'></span>\n </div>\n </ion-scroll>\n </ion-slide>\n </ion-slide-box>\n </ion-content>\n</ion-modal-view>\n");}]);
2 changes: 1 addition & 1 deletion dist/ion-gallery.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 0 additions & 14 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,13 @@ var sass = require('gulp-sass');
var ngAnnotate = require('gulp-ng-annotate');
var stripDebug = require('gulp-strip-debug');
var del = require('del');
var karma = require('karma').server;

gulp.task('default', ['compress','sass'], function() {
del(['.tmp/'], function (err, paths) {
console.log('Deleted files/folders:\n', paths.join('\n'));
});
});

/**
* Test task, run test once and exit
*/
gulp.task('test', function(done) {
karma.start({
configFile: __dirname + '/tests/my.conf.js',
singleRun: true
}, function() {
done();
});
});

gulp.task('lint', function() {
return gulp.src('./src/js/*.js')
.pipe(jshint())
Expand Down Expand Up @@ -62,4 +49,3 @@ gulp.task('sass', function () {
.pipe(sass({outputStyle: 'compressed'}))
.pipe(gulp.dest('./dist'));
});

19 changes: 4 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,18 @@
"version": "0.1.14",
"description": "Ionic gallery directive",
"main": "gulpfile.js",
"dependencies": {
"dependencies": {},
"devDependencies": {
"del": "^1.2.0",
"gulp": "^3.8.11",
"gulp-angular-templatecache": "^1.6.0",
"gulp-concat": "^2.5.2",
"gulp-jshint": "^1.10.0",
"gulp-uglify": "^1.2.0"
},
"devDependencies": {
"gulp": "^3.8.11",
"gulp-uglify": "^1.2.0",
"gulp-ng-annotate": "^0.5.3",
"gulp-rename": "^1.2.2",
"gulp-sass": "^2.0.1",
"gulp-strip-debug": "^1.0.2",
"jasmine-core": "^2.3.4",
"karma": "^0.12.36",
"karma-chrome-launcher": "^0.1.12",
"karma-jasmine": "^0.3.5",
"karma-phantomjs-launcher": "^0.2.0",
"phantomjs": "^1.9.17"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"gulp-strip-debug": "^1.0.2"
},
"keywords": [
"ionic",
Expand Down
8 changes: 0 additions & 8 deletions src/js/galleryHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,6 @@
col = 0;
}

if(!items[i].hasOwnProperty('sub')){
items[i].sub = '';
}

if(!items[i].hasOwnProperty('thumb')){
items[i].thumb = items[i].src;
}

items[i].position = i;

_gallery[row][col] = items[i];
Expand Down
2 changes: 1 addition & 1 deletion src/js/slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
$scope.selectedSlide = 1;
$scope.hideAll = false;

$scope.showImage = function(index) {
$scope.openSlider = function(index) {
$scope.slides = [];
currentImage = index;

Expand Down
Loading

0 comments on commit bc9837d

Please sign in to comment.