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

Revert "added DnD switcher" #14

Merged
merged 1 commit into from
Apr 3, 2015
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
3 changes: 1 addition & 2 deletions app/scripts/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ require('angular-ui-router');
require('angular-loading-bar');
require('ngDraggable');
require('angular-animate');
require('flux-angular');

angular.module('underscore', [])
.factory('_', function() {
Expand All @@ -30,7 +29,7 @@ angular.module('underscore', [])

angular
.module('navEditorApp', ['templates-main','underscore', 'ui.router', 'ui.bootstrap', 'ngDraggable',
'angular-szn-autocomplete', 'angular-loading-bar', 'ngAnimate', 'flux'])
'angular-szn-autocomplete', 'angular-loading-bar', 'ngAnimate'])
.config(function($urlRouterProvider, $locationProvider, cfpLoadingBarProvider) {
$urlRouterProvider.otherwise('/');
// $locationProvider.html5Mode(true);
Expand Down
9 changes: 1 addition & 8 deletions app/scripts/directives/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,7 @@ angular.module('navEditorApp')
controllerAs: 'actionsCtrl'
};
})
.controller('ActionsCtrl', function(AreaService, ModalService, $state, SettingsStore, flux, $scope) {
$scope.reorderingMode = SettingsStore.reorderingMode;
$scope.$listenTo(SettingsStore, 'reorderingModeChanged', function() {
$scope.reorderingMode = SettingsStore.reorderingMode;
});
.controller('ActionsCtrl', function(AreaService, ModalService, $state) {
this.save = function() {
this.saving = true;
AreaService.save().then(function() {
Expand All @@ -43,7 +39,4 @@ angular.module('navEditorApp')
$state.go('area.group', {areaid: newArea.Id});
});
};
this.changeReorderingMode = function() {
flux.dispatch('changeReorderingMode');
};
});
7 changes: 1 addition & 6 deletions app/scripts/directives/area.dir.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,7 @@ angular.module('navEditorApp')
controllerAs: 'areaCtrl'
};
})
.controller('AreaCtrl', function(AreaService, ModalService, $stateParams, $state, _, $scope, SettingsStore) {
$scope.reorderingMode = SettingsStore.reorderingMode;
$scope.$listenTo(SettingsStore, 'reorderingModeChanged', function() {
$scope.reorderingMode = SettingsStore.reorderingMode;
});

.controller('AreaCtrl', function(AreaService, ModalService, $stateParams, $state, _) {
this.areas = AreaService.getAreas();
this.$stateParams = $stateParams;

Expand Down
6 changes: 1 addition & 5 deletions app/scripts/directives/group.dir.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@ angular.module('navEditorApp')
url: '^/group/:areaid'
});
})
.controller('GroupCtrl', function(AreaService, ModalService, $stateParams, $state, _, $templateCache, $scope, SettingsStore) {
$scope.reorderingMode = SettingsStore.reorderingMode;
$scope.$listenTo(SettingsStore, 'reorderingModeChanged', function() {
$scope.reorderingMode = SettingsStore.reorderingMode;
});
.controller('GroupCtrl', function(AreaService, ModalService, $stateParams, $state, _, $templateCache) {
this.groups = AreaService.getGroups($stateParams.areaid);
this.$stateParams = $stateParams;

Expand Down
6 changes: 1 addition & 5 deletions app/scripts/directives/subarea.dir.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@ require('angular-ui-router');
* # group
*/
angular.module('navEditorApp')
.controller('SubAreaCtrl', function(AreaService, ModalService, $stateParams, $scope, _, SettingsStore) {
$scope.reorderingMode = SettingsStore.reorderingMode;
$scope.$listenTo(SettingsStore, 'reorderingModeChanged', function() {
$scope.reorderingMode = SettingsStore.reorderingMode;
});
.controller('SubAreaCtrl', function(AreaService, ModalService, $stateParams, $scope, _) {
this.subareas = AreaService.getSubAreas($stateParams.areaid, $scope.group.Id);
this.$stateParams = $stateParams;

Expand Down
26 changes: 0 additions & 26 deletions app/scripts/services/settings.service.js

This file was deleted.

10 changes: 3 additions & 7 deletions app/views/actions.view.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
<div class="well">
<div class="btn-group" role="group">
<button class="btn btn-default" ng-click="actionsCtrl.addArea()">Add area</button>
<button ng-disabled="actionsCtrl.downloading" class="btn btn-default" ng-click="actionsCtrl.download()">Download</button>
<button ng-disabled="actionsCtrl.saving" class="btn btn-primary" ng-click="actionsCtrl.save()">Save</button>
<button class="btn btn-default navbar-btn" ng-click="actionsCtrl.addArea()">Add area</button>
<button ng-disabled="actionsCtrl.downloading" class="btn btn-default navbar-btn" ng-click="actionsCtrl.download()">Download</button>
<button ng-disabled="actionsCtrl.saving" class="btn btn-primary navbar-btn" ng-click="actionsCtrl.save()">Save</button>
</div>
<button class="btn btn-default pull-right" data-toggle="button" ng-click="actionsCtrl.changeReorderingMode()">
<span ng-if="reorderingMode">DnD on</span>
<span ng-if="!reorderingMode">DnD off</span>
</button>
</div>
2 changes: 1 addition & 1 deletion app/views/area.view.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
class="entities__frame col-lg-3 col-md-4 col-sm-4 col-xs-6"
ng-drop-success="areaCtrl.onDropComplete($index, $data, $event)"
ng-drop="true">
<div class='entity area-entity' ng-drag="reorderingMode" ng-drag-data="area"
<div class='entity area-entity' ng-drag="true" ng-drag-data="area"
ng-class="{'area-entity--selected': areaCtrl.$stateParams.areaid === area.Id}">
<a draggable="false" class="entity-link" ui-sref="area.group({areaid: area.Id})">
<span class="entity-link__frame">{{area.Title}}</span>
Expand Down
2 changes: 1 addition & 1 deletion app/views/group.view.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
class='entities__frame col-lg-3 col-md-4 col-sm-4 col-xs-6'>
<div ng-drop-success="groupCtrl.onDropComplete($index, $data, $event)"
ng-drop="true">
<div class='entity group-entity' ng-drag="reorderingMode" ng-drag-data="group">
<div class='entity group-entity' ng-drag="true" ng-drag-data="group">
<span class="entity-link__frame">{{group.Title}}</span>
<div class="entity-menu-icon"></div>
<div class="entity-menu-container">
Expand Down
2 changes: 1 addition & 1 deletion app/views/subarea.view.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div ng-repeat="subarea in subAreaCtrl.subareas" class=" voffset"
ng-drop-success="subAreaCtrl.onDropComplete($index, $data, $event)"
ng-drop="true">
<div class='entity subarea-entity' ng-drag="reorderingMode"
<div class='entity subarea-entity' ng-drag="true"
ng-drag-data="subarea">
<div ng-if="subarea.IconPreviewUrl !== undefined" class="entity-image-container">
<img ng-src="{{subarea.IconPreviewUrl}}" />
Expand Down
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
"angular-szn-autocomplete": "^1.0.2",
"angular-ui-router": "^0.2.13",
"bootstrap": "3.3.4",
"flux-angular": "git://github.com/kalinichenko/flux-angular",
"jquery": "^2.1.3",
"napa": "^1.2.0",
"underscore": "^1.8.2"
},
"repository": {},
Expand Down