UNPKG

backbone.select

Version:

Selecting Backbone models; handling selections in Backbone collections.

101 lines (78 loc) 4.29 kB
<!doctype html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Backbone.Select: Focusing on one selected item in a Select.Many collection, using the `exclusive` option (AMD)</title> <!-- ATTN Foundation loaded without JS - stay clear of JS-driven widgets, or add the JS setup --> <link rel="stylesheet" href="../bower_demo_components/foundation/css/normalize.css"> <link rel="stylesheet" href="../bower_demo_components/foundation/css/foundation.css"> <link rel="stylesheet" href="../common.css"> <link rel="stylesheet" href="font-awesome.css"> <link rel="stylesheet" href="focus.css"> <script id="item-template" type="text/x-template"> <li class="item"><div class="content"><a href="#"><%= id %></a></div></li> </script> <script id="selected-template" type="text/x-template"> <li class="item pick"><div class="content"><%= id %></div><div class="action"><a href="#" class="focus"></a><a href="#" class="trash"></a></div></li> </script> <script id="in-focus-template" type="text/x-template"> <li class="item pick in-focus"><div class="content"><%= id %></div><div class="action"><a href="#" class="trash"></a></div></li> </script> </head> <body> <!-- check that 'bower install' has been run in the demo dir if bower.json isn't empty --> <script src="../bower-check.js"></script> <section id="header"> <h1 class="row">Backbone.Select</h1> <h2 class="row">Focusing on one selected item in a Select.Many collection, using the <code>exclusive</code> option (AMD)</h2> <p id="build-info" class="row"> <a href="#" id="close-build-info">×</a> This page uses the AMD build in the <code>dist</code> directory, not the files in <code>src</code>. In other words, run the <code>grunt</code> command first to build a current version. </p> </section> <section> <h3 class="row">Select.Many collection</h3> <p class="small info row">Click to select, <kbd>Ctrl</kbd>/<kbd></kbd> click to focus.</p> <div class="items row"> <ul id="list" class="small-block-grid-3 medium-block-grid-6 large-block-grid-6 list"></ul> </div> <h3 class="row">Selected <i class="selected-icon"></i></h3> <div class="items row"> <ul id="selected" class="small-block-grid-3 medium-block-grid-6 large-block-grid-6 list"></ul> </div> <h3 class="row">In focus <i class="in-focus-icon"></i></h3> <p class="small info row">Any number of items can be selected. Of the selected items, one can be in focus.</p> <div class="items row"> <ul id="in-focus" class="small-block-grid-3 medium-block-grid-6 large-block-grid-6 list"></ul> </div> </section> <!-- libraries --> <script src="../bower_demo_components/requirejs/require.js"></script> <!-- Runtime async script loading --> <script src="require-config.js"></script> <script> // Main file, set to the name of the main module. The name is defined in the paths config, in require-config.js. // If a path were used here, it would be relative to the baseUrl defined in require-config.js (which is set to // project root): // require( ['demo/amd/focus-exclusive'] ); require( ['local.focus-exclusive'] ); </script> <!-- For testing the output of r.js: - Generate an optimized r.js build (focus-exclusive-build.js) with `grunt requirejs`. For more info, see rjs/build-commands.md - Comment out the runtime async script loading, above - Uncomment the script tag below --> <!--<script src="rjs/output/unified/focus-exclusive-build.js"></script>--> <!-- Alternatively, also for testing r.js, use the multi-part build --> <!--<script src="rjs/output/parts/vendor.js"></script>--> <!--<script src="rjs/output/parts/focus-exclusive-app.js"></script>--> <script src="../bower_demo_components/outline.js/outline.js"></script> <script src="../close-build-info.js"></script> </body> </html>