5757 < li class ="active "> < a href ="# "> Home</ a > </ li >
5858 < li > < a href ="https://github.com/vitalets/angular-xeditable "> GitHub</ a > </ li >
5959 </ ul >
60- < form class ="navbar-form navbar-right "> < a href ="zip/angular-xeditable-0.8.0 .zip " style ="font-weight:bold " class ="btn btn-primary "> < span style ="margin-right:10px " class ="glyphicon glyphicon-save "> </ span > Download 0.8.0 ~ kb</ a > </ form >
60+ < form class ="navbar-form navbar-right "> < a href ="zip/angular-xeditable-0.8.1 .zip " style ="font-weight:bold " class ="btn btn-primary "> < span style ="margin-right:10px " class ="glyphicon glyphicon-save "> </ span > Download 0.8.1 ~ kb</ a > </ form >
6161 < div style ="padding-top: 13px ">
6262<!-- google+ -->
6363< div id ="socials " style ="text-align: center ">
141141 < li > < a href ="#edit-disabled "> Disable editing</ a > </ li >
142142 < li > < a href ="#editable-popover "> Editable Popover</ a > </ li >
143143 < li > < a href ="#uipopover "> Editable ui-bootstrap Popover</ a > </ li >
144+ < li > < a href ="#e-single "> Single editable in a form</ a > </ li >
144145 </ ul >
145146 </ li >
146147 < li > < a href ="#onbeforesave "> Submit</ a >
@@ -228,7 +229,7 @@ <h1>Get started</h1>
228229
229230 < pre class ="prettyprint "> <link href="https://netdna.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"></ pre >
230231 </ li >
231- < li > < span > Install angular-xeditable via </ span > < a href ="http://bower.io " target ="_blank "> bower</ a > < span > or </ span > < a href ="zip/angular-xeditable-0.8.0 .zip "> download latest zip </ a >
232+ < li > < span > Install angular-xeditable via </ span > < a href ="http://bower.io " target ="_blank "> bower</ a > < span > or </ span > < a href ="zip/angular-xeditable-0.8.1 .zip "> download latest zip </ a >
232233 < pre class ="prettyprint "> bower install angular-xeditable </ pre >
233234 </ li >
234235 < li > Include angular-xeditable into your project
@@ -240,9 +241,9 @@ <h1>Get started</h1>
240241 < pre class ="prettyprint "> var app = angular.module("app", ["xeditable"]);</ pre >
241242 </ li >
242243 < li > Set theme in app.run:
243- < pre class ="prettyprint "> app.run(function(editableOptions) {
244+ < pre class ="prettyprint "> app.run(['editableOptions', function(editableOptions) {
244245 editableOptions.theme = 'bs3'; // bootstrap3 theme. Can be also 'bs2', 'default'
245- });
246+ }] );
246247</ pre >
247248 </ li >
248249 < li > Markup element that should be editable
@@ -1566,6 +1567,37 @@ <h3>controller.js</h3>
15661567 name: 'awesome user',
15671568 location: 'location 1'
15681569 };
1570+ });</ pre >
1571+ </ section >
1572+ < section id ="e-single ">
1573+ < h1 > Single editable in a form</ h1 >
1574+ <!-- watch change of user to update rootScope for debugging-->
1575+ < h3 > demo</ h3 >
1576+ < div class ="well line-example "> < div ng-controller ="ESingleCtrl " id ="ESingleCtrl ">
1577+ < form >
1578+ < a href ="# " editable-text ="user.name " e-single > {{ user.name || 'empty' }}</ a >
1579+ </ form >
1580+ </ div > </ div >
1581+ < pre > {{ debug["e-single"] | json }}</ pre >
1582+ < p > < p > Add < code > e-single</ code > attribute when you want a single item to be clickable inside of a form.< br > It ignores the outer form.</ p >
1583+ </ p >
1584+ <!--script(src=dir+'/controller.js')-->
1585+ < script > app . controller ( 'ESingleCtrl' , function ( $scope ) {
1586+ $scope . user = {
1587+ name : 'awesome user'
1588+ } ;
1589+ $scope . $watch ( "user" , function ( v ) { $scope . $parent . debug [ "e-single" ] = v ; } ) ; } ) ; </ script >
1590+ < h3 > html</ h3 >
1591+ < pre class ="prettyprint ng-non-bindable "> <div ng-controller="ESingleCtrl" id="ESingleCtrl">
1592+ <form>
1593+ <a href="#" editable-text="user.name" e-single>{{ user.name || 'empty' }}</a>
1594+ </form>
1595+ </div></ pre >
1596+ < h3 > controller.js</ h3 >
1597+ < pre class ="prettyprint "> app.controller('ESingleCtrl', function($scope) {
1598+ $scope.user = {
1599+ name: 'awesome user'
1600+ };
15691601});</ pre >
15701602 </ section >
15711603 < section id ="onbeforesave ">
@@ -2739,26 +2771,26 @@ <h1>Themes</h1>
27392771< p > To display a clear button, set the < code > editableOptions.displayClearButton=true</ code > in < code > app.run</ code > .</ p >
27402772< p > To change the < code > title</ code > and < code > aria-label</ code > values of the submit/cancel/clear buttons, set the < code > editableOptions</ code > properties:</ p >
27412773
2742- < pre class ="prettyprint "> app.run(function(editableOptions) {
2774+ < pre class ="prettyprint "> app.run(['editableOptions', function(editableOptions) {
27432775 editableOptions.submitButtonTitle = 'Submit';
27442776 editableOptions.submitButtonAriaLabel = 'Submit';
27452777 editableOptions.cancelButtonTitle = 'Cancel';
27462778 editableOptions.cancelButtonAriaLabel = 'Cancel';
27472779 editableOptions.clearButtonTitle = 'Clear';
27482780 editableOptions.clearButtonAriaLabel = 'Clear';
2749- });
2781+ }] );
27502782</ pre >
27512783 < section id ="bootstrap3 "> </ section >
27522784 < h2 > Bootstrap 3</ h2 > < p > Include < a href ="http://getbootstrap.com "> Bootstrap 3</ a > CSS</ p >
27532785
27542786 < pre class ="prettyprint "> <link href="https://netdna.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"></ pre > < p > Set theme in < code > app.run</ code > :</ p >
27552787
2756- < pre class ="prettyprint "> app.run(function(editableOptions) {
2788+ < pre class ="prettyprint "> app.run(['editableOptions', function(editableOptions) {
27572789 editableOptions.theme = 'bs3';
2758- });
2790+ }] );
27592791</ pre > < p > To have smaller or bigger controls modify < code > inputClass</ code > and < code > buttonsClass</ code > properties of theme:</ p >
27602792
2761- < pre class ="prettyprint "> app.run(function(editableOptions, editableThemes) {
2793+ < pre class ="prettyprint "> app.run(['editableOptions', 'editableThemes', function(editableOptions, editableThemes) {
27622794 editableThemes.bs3.inputClass = 'input-sm';
27632795 editableThemes.bs3.buttonsClass = 'btn-sm';
27642796 editableOptions.theme = 'bs3';
@@ -2769,20 +2801,20 @@ <h2>Bootstrap 2</h2><p>Include <a href="http://getbootstrap.com/2.3.2">Bootstrap
27692801
27702802 < pre class ="prettyprint "> <link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet"></ pre > < p > Set theme in < code > app.run</ code > :</ p >
27712803
2772- < pre class ="prettyprint "> app.run(function(editableOptions) {
2804+ < pre class ="prettyprint "> app.run(['editableOptions', function(editableOptions) {
27732805 editableOptions.theme = 'bs2';
2774- });
2806+ }] );
27752807</ pre >
27762808 < section id ="default "> </ section >
27772809 < h2 > Default</ h2 > < p > No additional CSS required.< br > You can customize theme in < code > app.run</ code > by overwriting properties:</ p >
27782810
2779- < pre class ="prettyprint "> app.run(function(editableOptions, editableThemes) {
2811+ < pre class ="prettyprint "> app.run(['editableOptions', 'editableThemes', function(editableOptions, editableThemes)
27802812 // set `default` theme
27812813 editableOptions.theme = 'default';
27822814
27832815 // overwrite submit button template
27842816 editableThemes['default'].submitTpl = '<button type="submit">ok</button>';
2785- });
2817+ }] );
27862818</ pre > < p > Available properties of each theme you can see in source
27872819< a href ="https://github.com/vitalets/angular-xeditable/tree/master/src/js/themes.js "> themes.js</ a > </ p >
27882820< p > To change appearance of editable links you should overwrite CSS:</ p >
@@ -3022,10 +3054,10 @@ <h3>Methods</h3><p>Methods are available when you set <code>name</code> attribut
30223054 < h2 > Reference: editable options</ h2 >
30233055 < h3 > Options</ h3 > < p > Options are set in app.run</ p >
30243056
3025- < pre class ="prettyprint "> app.run(function(editableOptions) {
3057+ < pre class ="prettyprint "> app.run(['editableOptions', function(editableOptions) {
30263058editableOptions.theme = 'bs3';
30273059...
3028- });
3060+ }] );
30293061</ pre >
30303062 < table width ="100% " class ="table-bordered table-condensed ">
30313063 < thead >
0 commit comments