PageSourceSearch

https://researchmap.jp/js/menus/menus.js?1684482913

js researchmap.jp collected 2026-09-24 08:31:30 UTC 2,337 bytes, 111 lines download raw bytes

1/**
2 * @fileoverview Menus Javascript
3 * @author [email protected] (Shohei Nakajima)
4 */
5
6
7/**
8 * MenusController Javascript
9 *
10 * @param {string} Controller name
11 * @param {function($scope)} Controller
12 */
13NetCommonsApp.controller('MenusController', ['$scope', '$window', function($scope, $window) {
14
15  /**
16   * data
17   *
18   * @type {object}
19   */
20  $scope.menus = {};
21
22  /**
23   * Initialize
24   *
25   * @return {void}
26   */
27  $scope.initialize = function(key, data, toggle) {
28    $scope.menus[key] = data;
29    angular.forEach($scope.menus[key], function(domId) {
30      if (toggle) {
31        $('#' + domId).show();
32      } else {
33        $('#' + domId).hide();
34      }
35    });
36  };
37
38  /**
39   * 切り替え
40   *
41   * @return {void}
42   */
43  $scope.switchOpenClose = function($event, key) {
44    angular.forEach($scope.menus[key], function(domId) {
45      $('#' + domId).toggle();
46    });
47    if (angular.isObject($event)) {
48      $event.preventDefault();
49      $event.stopPropagation();
50    }
51  };
52
53  /**
54   * クリック
55   *
56   * @return {void}
57   */
58  $scope.linkClick = function(domId) {
59    var domEl = $('#' + domId);
60    if (angular.isObject(domEl[0])) {
61      $window.location.href = domEl[0].href;
62    }
63  };
64
65}]);
66
67
68/**
69 * MenusController Javascript
70 *
71 * @param {string} Controller name
72 * @param {function($scope)} Controller
73 */
74NetCommonsApp.controller('MenuFrameSettingsController', ['$scope', function($scope) {
75
76  /**
77   * チェッククリックした際に配下ページをチェックする
78   *
79   * @return {void}
80   */
81  $scope.checkChildPages = function($event, domChildPageIds) {
82    var checked = $event.target.checked;
83
84    angular.forEach(domChildPageIds, function(domId) {
85      var domEl = $('#' + domId);
86      if (angular.isObject(domEl[0])) {
87        domEl[0].checked = checked;
88      }
89    });
90  };
91
92  /**
93   * チェッククリックした際に配下ページをDisableにする
94   *
95   * @return {void}
96   */
97  $scope.disableChildPages = function($event, domChildPageIds) {
98    var checked = $event.target.checked;
99
100    angular.forEach(domChildPageIds, function(domId) {
101      var domEl = $('#' + domId);
102      if (angular.isObject(domEl[0])) {
103        if (! domEl[0].checked) {
104          domEl[0].checked = checked;
105        }
106        domEl[0].disabled = !checked;
107      }
108    });
109  };
110
111}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.