Git Product home page Git Product logo

angular-trap-all's Introduction

angular-trap-all

angular-trap-all disallows tabbing out of a specified area. It's useful when implementing modal dialogs to prevent the user from interacting with what's behind a modal mask by simply tabbing out of the dialog.

This is similar to jQuery trap input, but an angular version. It works for all accessible form elements inside a modal dialog, including select tag.

Download

via Bower

bower install angular-trap-all --save

Installation

  1. Include Angular-trap-all.js in your application after Angular.
<script src="bower_components/angular-trap-all/angular-trap-all.js"></script> 
  1. Inject it in your module as dependency.
    angular.module('myModule', [
    'gui.trapAll'
    ]);
  1. Then use as either element or attribute type directive.
 <trap-all></trap-all> or <div trap-all></div>
  1. And ofcourse specify trap start and end points in HTML, using data-trap attribute.
	<trap-all>

	<div class="modal-header">
		<button class="modal-header-close icon icon-size-sm icon-cross" ng-click="vm.closePopup()" data-trap="start" aria-label="Hit enter to close popup">
		</button>
		<span class="modal-header-title" ng-cloack>{{vm.popupTitle}}</span>
	</div>
	
	<div class="modal-body" ng-transclude> 
	</div>
	
	<div class="modal-footer">
        <button type="button" class="btn btn-faint" ng-click="vm.closePopup()"  aria-label="Hit enter to close popup">
            Close
        </button>
        <button type="button" class="btn btn-hero" data-trap="end" aria-label="Hit enter to save changes">Save changes</button>
    </div>
    
	</trap-all>

License

MIT

angular-trap-all's People

Contributors

veercg avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.