mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
focus feed url input when modal opens
This commit is contained in:
@@ -1,5 +1,21 @@
|
|||||||
var module = angular.module('commafeed.directives', []);
|
var module = angular.module('commafeed.directives', []);
|
||||||
|
|
||||||
|
module.directive('focus', [ '$timeout', function($timeout) {
|
||||||
|
return {
|
||||||
|
restrict : 'A',
|
||||||
|
link : function(scope, element, attrs) {
|
||||||
|
scope.$watch(attrs.focus, function(value) {
|
||||||
|
if (!value)
|
||||||
|
return;
|
||||||
|
$timeout(function() {
|
||||||
|
$(element).focus();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
} ]);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Open a popup window pointing to the url in the href attribute
|
* Open a popup window pointing to the url in the href attribute
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
<label class="control-label">${subscribe.feed_url}</label>
|
<label class="control-label">${subscribe.feed_url}</label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<input type="text" name="url" ng-model="sub.url" ng-blur="urlChanged()" placeholder="http://example.com/feed"
|
<input type="text" name="url" ng-model="sub.url" ng-blur="urlChanged()" placeholder="http://example.com/feed"
|
||||||
class="input-block-level" required ng-disabled="state=='loading'"></input>
|
class="input-block-level" required ng-disabled="state=='loading'" focus="isOpen"></input>
|
||||||
<span class="help-block" ng-show="!subscribeForm.url.$valid">${global.required}</span>
|
<span class="help-block" ng-show="!subscribeForm.url.$valid">${global.required}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user