You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@climate.apache.org by jo...@apache.org on 2013/06/13 01:18:07 UTC
svn commit: r1492480 - in /incubator/climate/trunk/rcmet/src/main/ui/app:
index.html js/directives.js js/directives/OnBlur.js
Author: joyce
Date: Wed Jun 12 23:18:06 2013
New Revision: 1492480
URL: http://svn.apache.org/r1492480
Log:
Resolves CLIMATE-96 - Split up directives.js
- Moves OnBlur directive to new file.
- Removes directives.js
Added:
incubator/climate/trunk/rcmet/src/main/ui/app/js/directives/OnBlur.js (with props)
Removed:
incubator/climate/trunk/rcmet/src/main/ui/app/js/directives.js
Modified:
incubator/climate/trunk/rcmet/src/main/ui/app/index.html
Modified: incubator/climate/trunk/rcmet/src/main/ui/app/index.html
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/rcmet/src/main/ui/app/index.html?rev=1492480&r1=1492479&r2=1492480&view=diff
==============================================================================
--- incubator/climate/trunk/rcmet/src/main/ui/app/index.html (original)
+++ incubator/climate/trunk/rcmet/src/main/ui/app/index.html Wed Jun 12 23:18:06 2013
@@ -236,10 +236,10 @@
<script src="js/controllers/RcmedSelectionCtrl.js"></script>
<script src="js/controllers/SettingsCtrl.js"></script>
<script src="js/filters.js"></script>
- <script src="js/directives.js"></script>
<script src="js/directives/LeafletMap.js"></script>
<script src="js/directives/BootstrapModal.js"></script>
<script src="js/directives/BootstrapModalOpen.js"></script>
<script src="js/directives/PredictiveFileBrowserInput.js"></script>
+ <script src="js/directives/OnBlur.js"></script>
</body>
</html>
Added: incubator/climate/trunk/rcmet/src/main/ui/app/js/directives/OnBlur.js
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/rcmet/src/main/ui/app/js/directives/OnBlur.js?rev=1492480&view=auto
==============================================================================
--- incubator/climate/trunk/rcmet/src/main/ui/app/js/directives/OnBlur.js (added)
+++ incubator/climate/trunk/rcmet/src/main/ui/app/js/directives/OnBlur.js Wed Jun 12 23:18:06 2013
@@ -0,0 +1,34 @@
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements.See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License.You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+// The onBlur directive calls a passed function when a field's "blur" event is called.
+// The function should be passed as part of the "on-blur" attribute and be defined in
+// the containing scope.
+//
+// Consider the test function "testFunc". If you wanted this to run on the blur event
+// for an input box you would use the following:
+// <input type="text" on-blur="testFunc();" />
+angular.module('rcmes').directive('onBlur', function() {
+ return {
+ restrict: 'A',
+ link: function($scope, $elem, $attrs) {
+ $elem.bind('blur', function() {
+ $scope.$eval($attrs.onBlur);
+ });
+ },
+ };
+ });
Propchange: incubator/climate/trunk/rcmet/src/main/ui/app/js/directives/OnBlur.js
------------------------------------------------------------------------------
svn:executable = *