• Stars
    star
    310
  • Rank 134,926 (Top 3 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 11 years ago
  • Updated about 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

CSS3 Pull-to-Refresh directive for AngularJS

ngPullToRefresh Build Status

mgcrea.pullToRefresh is a module providing a simple css-only pull-to-refresh component leveraging native style momentum scrolling -webkit-overflow-scroll: touch.

The directive has a configurable built-in debounce system (400ms treshold by default) and can leverage angular $q promises.

Quick start

  • Install the module with bower
$ bower install angular-pull-to-refresh --save
  • Include the required libraries:
<link rel="stylesheet" href="bower_components/angular-pull-to-refresh/dist/angular-pull-to-refresh.min.css">
<script src="bower_components/angular-pull-to-refresh/dist/angular-pull-to-refresh.min.js"></script>
  • Inject the mgcrea.pullToRefresh module into your app:
angular.module('myApp', ['mgcrea.pullToRefresh']);

Examples

Demo

You can check out a working demo there (only works on touch devices):

<div class="content">
  <ul class="list-group list-group-table" pull-to-refresh="onReload()">
    <li class="list-group-item" ng-repeat="state in states" ng-bind="state"></li>
  </ul>
</div>
angular.module('myApp')

  .controller('AppCtrl', function($scope, $q) {

    $scope.states = ['Alabama', 'Alaska', 'Arizona', 'Arkansas', 'California', 'Colorado', 'Connecticut', 'Delaware', 'Florida', 'Georgia', 'Hawaii', 'Idaho', 'Illinois', 'Indiana', 'Iowa', 'Kansas', 'Kentucky', 'Louisiana', 'Maine', 'Maryland', 'Massachusetts', 'Michigan', 'Minnesota', 'Mississippi', 'Missouri', 'Montana', 'Nebraska', 'Nevada', 'New Hampshire', 'New Jersey', 'New Mexico', 'New York', 'North Dakota', 'North Carolina', 'Ohio', 'Oklahoma', 'Oregon', 'Pennsylvania', 'Rhode Island', 'South Carolina', 'South Dakota', 'Tennessee', 'Texas', 'Utah', 'Vermont', 'Virginia', 'Washington', 'West Virginia', 'Wisconsin', 'Wyoming'];

    $scope.onReload = function() {
      console.warn('reload');
      var deferred = $q.defer();
      setTimeout(function() {
        deferred.resolve(true);
      }, 1000);
      return deferred.promise;
    };

  });

Contributing

Please submit all pull requests the against master branch. If your unit test contains JavaScript patches or features, you should include relevant unit tests. Thanks!

Authors

Olivier Louvignes

Copyright and license

The MIT License

Copyright (c) 2012 Olivier Louvignes

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

More Repositories

1

angular-strap

AngularJS 1.2+ native directives for Bootstrap 3.
JavaScript
5,737
star
2

node-xlsx

NodeJS excel file parser & builder
TypeScript
2,789
star
3

angular-motion

Fancy CSS3 animations for AngularJS 1.2+.
CSS
453
star
4

redux-rest-resource

Seamless REST interaction for Redux
TypeScript
189
star
5

angular-7min

Angular Seven Minute Workout sample mobile app w/ Cordova
CSS
126
star
6

ansible-web-playbooks

Set of playbooks roles to orchestrate your web servers, powered by Ansible.
Shell
119
star
7

cordova-push-notification

Cordova ARC plugin for Push Notifications
Objective-C
100
star
8

docker-compose-gitlab-ce

Compose file for Gitlab Community Edition
Ruby
97
star
9

cordova-facebook-connect

Cordova ARC plugin for the Facebook SDK
Objective-C
94
star
10

bootstrap-additions

CSS extension kit for Twitter Bootstrap 3.0+
CSS
83
star
11

node-openssl-wrapper

NodeJS OpenSSL wrapper
JavaScript
58
star
12

react-native-dnd

Modern and easy-to-use drag&drop library for react-native.
TypeScript
56
star
13

homebridge-tydom

Homebridge plugin to manage Tydom hardware by Delta Dore from Apple HomeKit.
TypeScript
50
star
14

angular-overflow-scroll

CSS3 Overflow Scroll directive for AngularJS
JavaScript
46
star
15

cake_websocket

WebSocket Client for CakePHP.
PHP
42
star
16

angular-cordova

Cordova/PhoneGap services for AngularJS
JavaScript
40
star
17

node-easyrsa

Node.js public key infrastructure management library inspired by EasyRSA.
JavaScript
36
star
18

generator-angular-component

Lean yeoman generator for AngularJS components
JavaScript
34
star
19

cordova-pickerview

Cordova ARC plugin for UIPickerView
Objective-C
34
star
20

node-plist-native

Node.js native plist parser & builder
JavaScript
24
star
21

gulp-concat-util

🚧 This module is deprecated and not maintained anymore
JavaScript
24
star
22

fastify-session

Session plugin for fastify that supports both stateless and sateful sessions
TypeScript
24
star
23

docker-compose-tick-stack

Compose file for the TICK stack: Telegraf, InfluxDB, Chronograf, Kapacitor
Shell
24
star
24

angular-touch-nav

Touch navigation plugin for AngularJS
JavaScript
21
star
25

angular-resource-collection

Backbone-like collections for AngularJS resources
JavaScript
20
star
26

fastify-request-logger

Compact request logger plugin for fastify
TypeScript
19
star
27

node-tydom-client

Easily manage Tydom hardware by Delta Dore from Node.js
TypeScript
18
star
28

fastify-session-redis-store

Redis store for fastify-session using ioredis
TypeScript
17
star
29

cordova-plugin-unity

Integrate Unity in your Cordova projects
Objective-C
17
star
30

scheme.mg.monokai

Monokai scheme for various editors
15
star
31

js-canvas-object-fit

Easily draw images in your canvas with object-type contraints.
JavaScript
15
star
32

pino-pretty-compact

Compact pino-based prettifier for fastify
TypeScript
14
star
33

generator-angular-bootstrap

Lean yeoman generator for AngularJS (deprecated)
JavaScript
14
star
34

cordova-actionsheet

Cordova ARC plugin for UIActionSheet
Objective-C
14
star
35

node-mediainfo-parser

NodeJS MediaInfo parser
JavaScript
13
star
36

cordova-plugin-volume-control

Cordova Volume Control Plugin
Objective-C
13
star
37

babel-plugin-relative-import

🚧 This module is deprecated and not maintained anymore
JavaScript
12
star
38

redux-local-scope

Locally scope your redux store modules (eg. types, actions, reducers) to easily reuse them.
JavaScript
12
star
39

docker-node-opencv

Docker image for NodeJS with OpenCV
Makefile
12
star
40

sencha-touch-plugins

Plugins for Sencha Touch 2.0
JavaScript
12
star
41

grunt-nginclude

Grunt task for embedding AngularJS static ngInclude elements.
JavaScript
11
star
42

li3_assetic

Bring the power of Assetic to the Lithium framework
PHP
10
star
43

angular-bone

Backbone services for Angular
JavaScript
9
star
44

js-xhr-file

Upload/Download files using XMLHttpRequest with a Promise-based API.
JavaScript
9
star
45

react-webpack-factory

Lean yet powerful starter-kit to build modern React applications.
JavaScript
8
star
46

node-web-watcher

NodeJS agent that monitors a web page and act upon changes.
JavaScript
8
star
47

node-vnc-snapshot

NodeJS VNC snapshot tool
JavaScript
8
star
48

gulp-through

Gulp stream transform factory
JavaScript
8
star
49

webpack-component-resolver-plugin

[deprecated] Webpack2 plugin to resolve components based on their dirname
JavaScript
8
star
50

babel-plugin-module-name-mapper

Babel plugin to alias module resolution with monorepo support
JavaScript
7
star
51

cordova-secureudid

Cordova ARC plugin for SecureUDID
Objective-C
7
star
52

angular-jquery

🚧 This module is deprecated and not maintained anymore
JavaScript
7
star
53

node-influx-syslog

Node.js InfluxDB syslog logger powered by bunyan
TypeScript
7
star
54

homebridge-frisquet-connect

Homebridge plugin to manage Frisquet Connect from Apple HomeKit.
TypeScript
7
star
55

docker-unifi

Docker image for Ubiquiti Unifi Controller
Shell
7
star
56

prisma-queue

Minimalist postgresql job queue for Prisma
TypeScript
7
star
57

cordova-messagebox

Cordova ARC plugin for UIAlertView
Objective-C
7
star
58

babel-plugin-component-resolver

🚧 This module is deprecated and not maintained anymore
JavaScript
7
star
59

image-moments

Javascript image moments
JavaScript
7
star
60

fastify-session-sodium-crypto

Fast sodium-based crypto for fastify-session
TypeScript
6
star
61

gulp-nginclude

🚧 This module is deprecated and not maintained anymore
JavaScript
6
star
62

gulp-cleancss

🚧 This module is deprecated and not maintained anymore
JavaScript
6
star
63

create-app

Fast scaffolding for TypeScript projects
TypeScript
6
star
64

li3_facebook

Facebook plugin for lithium
PHP
5
star
65

mongoose-plugin-events

React on database changes with document and models events
JavaScript
5
star
66

dotfiles

Shell
4
star
67

gulp-ngtemplate

Gulp task to precompile AngularJS templates with $templateCache
JavaScript
4
star
68

babel-core

Babel is a compiler for writing next generation JavaScript.
JavaScript
4
star
69

express-resumablejs

Resumable.js stream middleware for Express 4+
JavaScript
4
star
70

babel-plugin-directory-resolver

Babel plugin to customize directory resolution
JavaScript
4
star
71

cake_assetic

CakePHP Assetic Plugin
PHP
4
star
72

docker-unifi-video

Docker image for Ubiquiti Unifi Video Controller
Dockerfile
4
star
73

li3_behaviors

Implementation of model behaviors for Lithium
PHP
4
star
74

fastify-session-prisma-store

Prisma store for fastify-session
TypeScript
4
star
75

react-native-macos-splitview

NSSplitView component for react-native on macOS
TypeScript
4
star
76

node-ios-browser

iOS Command Line Browser
Objective-C
3
star
77

cake.mg.utils

Some utilities for CakePHP
PHP
3
star
78

eslint-config-mgcrea

ESLint configuration
JavaScript
3
star
79

bower-angular2-build

JavaScript
3
star
80

fastify-graceful-exit

Graceful exit your fastify application
TypeScript
3
star
81

node-gitlab-tools

NodeJS Toolkit & CLI for GitLab
JavaScript
3
star
82

create-fastify-backend

Quickly start a backend project powered by fastify
TypeScript
3
star
83

react-toolbox-starter-kit

Quickstart powered by create-react-app to play with react-toolbox
JavaScript
2
star
84

react-native-sandbox

Java
2
star
85

angular-webpack-factory

Lean yet powerful starter-kit to build modern Angular applications.
JavaScript
2
star
86

mongozest

Modern & Light MongoDB ORM for Node.js
TypeScript
2
star
87

react-native-tone-generator

Play generated tones using android ToneGenerator
TypeScript
2
star
88

jquery.ui.mg.selectwheel

Handle a iPhone-like selectwheel
JavaScript
2
star
89

li3_less

Less plugin for lithium
PHP
2
star
90

jquery.mg.screensaver

Quickly setup a screensaver
JavaScript
2
star
91

docker-node

Docker image for NodeJS
Shell
2
star
92

cordova-plugin-seed

Cordova ARC plugin seed template
Objective-C
2
star
93

aoc-2022-typescript

TypeScript Advent of Code 2022
TypeScript
2
star
94

node-sodium-jwt

Fast sodium-based crypto for signing and verifying json web tokens (JWT)
TypeScript
1
star
95

cake.facebook

CakePHP Facebook Plugin
PHP
1
star
96

aoc-2022-rust

Rust Advent of Code 2022
Rust
1
star
97

cloud-testing

PHP
1
star
98

eslint-config

JavaScript
1
star
99

kite

Lightweight HTTP client based on the browser Fetch API
TypeScript
1
star
100

jquery.mg.toggleable

Quickly setup triggers & toggles
JavaScript
1
star