mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-11 19:49:18 +08:00
Scroll stuff
This commit is contained in:
30
dist/js/ionic-angular.js
vendored
30
dist/js/ionic-angular.js
vendored
@@ -508,6 +508,9 @@ angular.module('ionic.ui.list', ['ngAnimate'])
|
||||
</div>\
|
||||
<div class="item-content slide-left" ng-transclude>\
|
||||
</div>\
|
||||
<div class="item-drag" ng-if="canReorder && isEditing">\
|
||||
<button data-ionic-action="reorder" class="button button-icon"><i ng-class="reorderIcon"></i></button>\
|
||||
</div>\
|
||||
<div class="item-options" ng-if="canSwipe && !isEditing && showOptions">\
|
||||
<button ng-click="buttonClicked(button)" class="button" ng-class="button.type" ng-repeat="button in buttons">{{button.text}}</button>\
|
||||
</div>\
|
||||
@@ -588,7 +591,10 @@ angular.module('ionic.ui.list', ['ngAnimate'])
|
||||
|
||||
compile: function(element, attr, transclude) {
|
||||
return function($scope, $element, $attr) {
|
||||
var lv = new ionic.views.List({el: $element[0]});
|
||||
var lv = new ionic.views.ListView({
|
||||
el: $element[0],
|
||||
listEl: $element[0].children[0]
|
||||
});
|
||||
|
||||
if(attr.animation) {
|
||||
$element.addClass(attr.animation);
|
||||
@@ -916,6 +922,28 @@ angular.module('ionic.ui.nav', ['ionic.service.templateLoad', 'ionic.service.ges
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* @description
|
||||
* The scroll directive lets you enable a content area for
|
||||
* our custom momentum scrolling area. The benefit to a custom
|
||||
* scroll area is configurability, and avoidance of the
|
||||
* buggy -webkit-overflow-scrolling: touch.
|
||||
*/
|
||||
|
||||
angular.module('ionic.ui.scroll', [])
|
||||
|
||||
.directive('scroll', function() {
|
||||
return {
|
||||
restrict: 'ECA',
|
||||
replace: true,
|
||||
transclude: true,
|
||||
template: '<div class="scroll-content" ng-transclude></div>'
|
||||
};
|
||||
});
|
||||
;
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* @description
|
||||
* The sideMenuCtrl lets you quickly have a draggable side
|
||||
|
||||
11
dist/js/ionic.js
vendored
11
dist/js/ionic.js
vendored
@@ -3012,13 +3012,6 @@ window.ionic = {
|
||||
// Start the drag states
|
||||
this._initDrag();
|
||||
|
||||
// Listen for drag and release events
|
||||
window.ionic.onGesture('drag', function(e) {
|
||||
_this._handleDrag(e);
|
||||
}, this.el);
|
||||
window.ionic.onGesture('release', function(e) {
|
||||
_this._handleEndDrag(e);
|
||||
}, this.el);
|
||||
};
|
||||
|
||||
ionic.views.List.prototype = {
|
||||
@@ -3053,6 +3046,8 @@ window.ionic = {
|
||||
|
||||
this._isDragging = false;
|
||||
|
||||
return false;
|
||||
|
||||
// Check if this is a reorder drag
|
||||
if(ionic.DomUtil.getParentOrSelfWithClass(e.target, 'list-item-drag') && (e.gesture.direction == 'up' || e.gesture.direction == 'down')) {
|
||||
var item = this._getItem(e.target);
|
||||
@@ -3090,6 +3085,7 @@ window.ionic = {
|
||||
|
||||
_handleEndDrag: function(e) {
|
||||
var _this = this;
|
||||
return false;
|
||||
|
||||
if(!this._dragOp) {
|
||||
this._initDrag();
|
||||
@@ -3106,6 +3102,7 @@ window.ionic = {
|
||||
*/
|
||||
_handleDrag: function(e) {
|
||||
var _this = this, content, buttons;
|
||||
return false;
|
||||
|
||||
if(!this._dragOp) {
|
||||
this._startDrag(e);
|
||||
|
||||
Reference in New Issue
Block a user