From b4288906e4350eed8f40116205018c9cfd92d490 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Mon, 19 Dec 2016 13:19:29 +0000 Subject: [PATCH] added enter-key binding to a username input box in the project map view --- codepot/src/codepot/views/project_map.php | 33 +++++++++++------------ codepot/src/css/project.css | 7 +++++ 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/codepot/src/codepot/views/project_map.php b/codepot/src/codepot/views/project_map.php index b22ac3f2..f66db6cb 100644 --- a/codepot/src/codepot/views/project_map.php +++ b/codepot/src/codepot/views/project_map.php @@ -54,7 +54,6 @@ var GraphApp = (function() } this.graph_container = $('#' + graph_container_id); - this.refresh_button_inited = false; this.refresh_button = $('#' + refresh_button_id); this.refresh_spin = $('#' + refresh_spin_id); this.refresh_progress = $('#' + refresh_progress_id); @@ -212,6 +211,21 @@ var GraphApp = (function() // ------------------------------------------------------------------- // PUBLIC FUNCTIONS // ------------------------------------------------------------------- + App.prototype.initWidgets = function () + { + var self = this; + this.refresh_button.button().click (function () + { + self.refresh (self.filter.val().trim()); + return false; + }); + + // not a real button. button() for styling only + this.filter.button().bind ('keyup', function(e) { + if (e.keyCode == 13) self.triggerRefresh (); + }); + }; + App.prototype.refresh = function (filter) { var url = this.url_base; @@ -224,21 +238,6 @@ var GraphApp = (function() this.ajax_req = $.ajax ({url: url, context: this, success: show_graph, error: handle_error }); }; - App.prototype.initRefresh = function () - { - if (!this.refresh_button_inited) - { - this.refresh_button_inited = true; - - var self = this; - this.refresh_button.button().click (function () - { - self.refresh (self.filter.val().trim()); - return false; - }); - } - }; - App.prototype.triggerRefresh = function () { this.refresh_button.trigger ('click'); @@ -275,8 +274,8 @@ $(function () 'project_map_filter', 'project_map_title_band', 'codepot_footer', 'project_map_alert'); + graph_app.initWidgets (); $(window).resize(function () { graph_app.resize(); }); - graph_app.initRefresh (); graph_app.triggerRefresh (); }); diff --git a/codepot/src/css/project.css b/codepot/src/css/project.css index 71ae5eea..88162e24 100644 --- a/codepot/src/css/project.css +++ b/codepot/src/css/project.css @@ -388,3 +388,10 @@ #project_list_mainarea_result_my_issues { padding: 0; } + +/*----------------------------------------------- + * project map view + *-----------------------------------------------*/ +#project_map_filter { + text-align: left; +}