Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Click views #31

Merged
merged 7 commits into from
Aug 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion app/scripts/controllers/brand.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ angular.module('endslaverynowApp')
$scope.relatedCategories = [];

dataRepositoryFactory.ready(
$scope,
function () {
var dataRepository = dataRepositoryFactory.getDataRepository();
// Get brand information
Expand Down
1 change: 0 additions & 1 deletion app/scripts/controllers/categories.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ angular.module('endslaverynowApp')
$scope.allCategories = [];

dataRepositoryFactory.ready(
$scope,
function () {
$scope.allCategories = dataRepositoryFactory.getDataRepository().getCategories();

Expand Down
1 change: 0 additions & 1 deletion app/scripts/controllers/category.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ angular.module('endslaverynowApp')
$scope.relatedCategories = [];

dataRepositoryFactory.ready(
$scope,
function () {
var dataRepository = dataRepositoryFactory.getDataRepository();
// Get brand information
Expand Down
1 change: 0 additions & 1 deletion app/scripts/controllers/certifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ angular.module('endslaverynowApp')
'dataRepositoryFactory',
function ($scope, dataRepositoryFactory) {
dataRepositoryFactory.ready(
$scope,
function () {
// Get certification information
$scope.certifications = dataRepositoryFactory.getDataRepository().getCertifications();
Expand Down
1 change: 0 additions & 1 deletion app/scripts/controllers/editBrand.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ angular.module('endslaverynowApp').controller('EditBrandCtrl', [
$scope.Image = null;

dataRepositoryFactory.ready(
$scope,
function () {
$scope.dataRepository = dataRepositoryFactory.getDataRepository();

Expand Down
9 changes: 4 additions & 5 deletions app/scripts/controllers/editBrands.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,15 @@
*/
angular.module('endslaverynowApp').controller('EditBrandsCtrl', [
'$scope',
'$window',
'$state',
'dataRepositoryFactory',
function ($scope, $window, dataRepositoryFactory) {
function ($scope, $state, dataRepositoryFactory) {
$scope.loaded = false;
$scope.dataRepository = null;

$scope.brands = [];

dataRepositoryFactory.ready(
$scope,
function () {
$scope.dataRepository = dataRepositoryFactory.getDataRepository();
$scope.brands = $scope.dataRepository.getBrands();
Expand All @@ -38,8 +37,8 @@ angular.module('endslaverynowApp').controller('EditBrandsCtrl', [
$scope.dataRepository.deleteBrand(
brand,
function () {
// @TODO: We need to find a more efficient/nicer way of refreshing the list of brands.
$window.location.reload();
window.alert('Brand has been deleted');
$state.reload();
}
);
};
Expand Down
9 changes: 4 additions & 5 deletions app/scripts/controllers/editCategories.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,16 @@
*/
angular.module('endslaverynowApp').controller('EditCategoriesCtrl', [
'$scope',
'$window',
'$state',
'dataRepositoryFactory',
function ($scope, $window, dataRepositoryFactory) {
function ($scope, $state, dataRepositoryFactory) {
$scope.dataRepository = null;

$scope.loaded = false;

$scope.categories = [];

dataRepositoryFactory.ready(
$scope,
function () {
$scope.dataRepository = dataRepositoryFactory.getDataRepository();
$scope.categories = $scope.dataRepository.getCategories();
Expand All @@ -39,8 +38,8 @@ angular.module('endslaverynowApp').controller('EditCategoriesCtrl', [
$scope.dataRepository.deleteCategory(
category,
function () {
// @TODO: We need to find a more efficient/nicer way of refreshing the list of brands.
$window.location.reload();
window.alert('Category has been deleted');
$state.reload();
}
);
};
Expand Down
1 change: 0 additions & 1 deletion app/scripts/controllers/editCategory.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ angular.module('endslaverynowApp').controller('EditCategoryCtrl', [
$scope.Image = null;

dataRepositoryFactory.ready(
$scope,
function () {
$scope.dataRepository = dataRepositoryFactory.getDataRepository();

Expand Down
1 change: 0 additions & 1 deletion app/scripts/controllers/editProduct.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ angular.module('endslaverynowApp').controller('EditProductCtrl', [
$scope.Image = null;

dataRepositoryFactory.ready(
$scope,
function () {
$scope.dataRepository = dataRepositoryFactory.getDataRepository();

Expand Down
9 changes: 4 additions & 5 deletions app/scripts/controllers/editProducts.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,16 @@
*/
angular.module('endslaverynowApp').controller('EditProductsCtrl', [
'$scope',
'$window',
'$state',
'dataRepositoryFactory',
function ($scope, $window, dataRepositoryFactory) {
function ($scope, $state, dataRepositoryFactory) {
$scope.dataRepository = null;

$scope.loaded = false;

$scope.products = [];

dataRepositoryFactory.ready(
$scope,
function () {
$scope.dataRepository = dataRepositoryFactory.getDataRepository();
$scope.products = $scope.dataRepository.getProducts();
Expand Down Expand Up @@ -57,8 +56,8 @@ angular.module('endslaverynowApp').controller('EditProductsCtrl', [
$scope.dataRepository.deleteProduct(
product,
function () {
// @TODO: We need to find a more efficient/nicer way of refreshing the list of brands.
$window.location.reload();
window.alert('Product has been deleted');
$state.reload();
}
);
};
Expand Down
8 changes: 4 additions & 4 deletions app/scripts/controllers/formAdd.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ angular.module('endslaverynowApp')
.controller('FormAddCtrl', [
'$stateParams',
'$scope',
'$window',
'$state',
'Upload',
'dataRepositoryFactory',
function ($stateParams, $scope, $window, Upload, dataRepositoryFactory) {
function ($stateParams, $scope, $state, Upload, dataRepositoryFactory) {
$scope.brandId = $stateParams.id;
$scope.loaded = false;

Expand Down Expand Up @@ -104,7 +104,6 @@ angular.module('endslaverynowApp')
};

dataRepositoryFactory.ready(
$scope,
function () {
var dataRepository = dataRepositoryFactory.getDataRepository();
$scope.categories = alphabetizeCollection(dataRepository.getCategories().filter(Boolean));
Expand Down Expand Up @@ -238,6 +237,7 @@ angular.module('endslaverynowApp')
};

$scope.reloadPage = function () {
$window.location.reload();
// This reloads the page (controller) and the data (not that any is visible) without reloading the entire app.
$state.reload();
};
}]);
1 change: 0 additions & 1 deletion app/scripts/controllers/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ angular.module('endslaverynowApp')
$scope.categories = [];

dataRepositoryFactory.ready(
$scope,
function () {
$scope.categories = dataRepositoryFactory.getDataRepository().getTopLevelCategories();

Expand Down
1 change: 0 additions & 1 deletion app/scripts/controllers/product.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ angular.module('endslaverynowApp')
$scope.dataRepository = null;

dataRepositoryFactory.ready(
$scope,
function () {
$scope.dataRepository = dataRepositoryFactory.getDataRepository();

Expand Down
Loading