From 3cfbd2b1601842feea0a7739098a90e2d1dccec4 Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Mon, 11 Apr 2016 18:27:34 +0100 Subject: Added loading icon to import buttons See #14488 for more details --- app/assets/javascripts/importer_status.js.coffee | 39 ++++++++++++++++-------- app/assets/stylesheets/pages/import.scss | 21 +++++++++++++ 2 files changed, 48 insertions(+), 12 deletions(-) (limited to 'app/assets') diff --git a/app/assets/javascripts/importer_status.js.coffee b/app/assets/javascripts/importer_status.js.coffee index be8d225e73b..c51c4a1a182 100644 --- a/app/assets/javascripts/importer_status.js.coffee +++ b/app/assets/javascripts/importer_status.js.coffee @@ -4,18 +4,33 @@ class @ImporterStatus this.setAutoUpdate() initStatusPage: -> - $(".js-add-to-import").click (event) => - new_namespace = null - tr = $(event.currentTarget).closest("tr") - id = tr.attr("id").replace("repo_", "") - if tr.find(".import-target input").length > 0 - new_namespace = tr.find(".import-target input").prop("value") - tr.find(".import-target").empty().append(new_namespace + "/" + tr.find(".import-target").data("project_name")) - $.post @import_url, {repo_id: id, new_namespace: new_namespace}, dataType: 'script' - - $(".js-import-all").click (event) => - $(".js-add-to-import").each -> - $(this).click() + $(".js-add-to-import") + .off 'click' + .on 'click', (event) => + new_namespace = null + $btn = $(event.currentTarget) + $tr = $btn.closest("tr") + id = $tr.attr("id").replace("repo_", "") + if $tr.find(".import-target input").length > 0 + new_namespace = $tr.find(".import-target input").prop("value") + $tr.find(".import-target").empty().append(new_namespace + "/" + $tr.find(".import-target").data("project_name")) + + $btn + .disable() + .addClass 'is-loading' + + $.post @import_url, {repo_id: id, new_namespace: new_namespace}, dataType: 'script' + + $(".js-import-all") + .off 'click' + .on 'click', (event) => + $btn = $(event.currentTarget) + $btn + .disable() + .addClass 'is-loading' + + $(".js-add-to-import").each -> + $(this).click() setAutoUpdate: -> setInterval (=> diff --git a/app/assets/stylesheets/pages/import.scss b/app/assets/stylesheets/pages/import.scss index 6a99cd9cb94..84cc35239f9 100644 --- a/app/assets/stylesheets/pages/import.scss +++ b/app/assets/stylesheets/pages/import.scss @@ -16,3 +16,24 @@ i.icon-gitorious-big { width: 18px; height: 18px; } + +.import-jobs-from-col, +.import-jobs-to-col { + width: 40%; +} + +.import-jobs-status-col { + width: 20%; +} + +.btn-import { + .loading-icon { + display: none; + } + + &.is-loading { + .loading-icon { + display: inline-block; + } + } +} -- cgit v1.2.1 From 970b2ed9da79b39123d2e21e6e6d5c70779e903c Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Wed, 13 Apr 2016 16:10:03 +0100 Subject: Updated MR compare Based on in feedback in !3228 --- app/assets/stylesheets/pages/commits.scss | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'app/assets') diff --git a/app/assets/stylesheets/pages/commits.scss b/app/assets/stylesheets/pages/commits.scss index 6453c91d955..c8c6bbde084 100644 --- a/app/assets/stylesheets/pages/commits.scss +++ b/app/assets/stylesheets/pages/commits.scss @@ -75,6 +75,11 @@ li.commit { } } + .item-title { + display: inline-block; + max-width: 70%; + } + .commit-row-description { font-size: 14px; border-left: 1px solid #eee; -- cgit v1.2.1 From 3d438870f34cb1bd5667bc5db2f848c4f82d5d25 Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Thu, 14 Apr 2016 09:32:02 +0100 Subject: Updated based on feedback --- app/assets/javascripts/importer_status.js.coffee | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'app/assets') diff --git a/app/assets/javascripts/importer_status.js.coffee b/app/assets/javascripts/importer_status.js.coffee index c51c4a1a182..95f9f86c0ad 100644 --- a/app/assets/javascripts/importer_status.js.coffee +++ b/app/assets/javascripts/importer_status.js.coffee @@ -4,16 +4,16 @@ class @ImporterStatus this.setAutoUpdate() initStatusPage: -> - $(".js-add-to-import") + $('.js-add-to-import') .off 'click' .on 'click', (event) => new_namespace = null $btn = $(event.currentTarget) - $tr = $btn.closest("tr") - id = $tr.attr("id").replace("repo_", "") - if $tr.find(".import-target input").length > 0 - new_namespace = $tr.find(".import-target input").prop("value") - $tr.find(".import-target").empty().append(new_namespace + "/" + $tr.find(".import-target").data("project_name")) + $tr = $btn.closest('tr') + id = $tr.attr('id').replace('repo_', '') + if $tr.find('.import-target input').length > 0 + new_namespace = $tr.find('.import-target input').prop('value') + $tr.find('.import-target').empty().append("#{new_namespace} / #{$tr.find('.import-target').data('project_name')}") $btn .disable() @@ -21,15 +21,15 @@ class @ImporterStatus $.post @import_url, {repo_id: id, new_namespace: new_namespace}, dataType: 'script' - $(".js-import-all") + $('.js-import-all') .off 'click' - .on 'click', (event) => - $btn = $(event.currentTarget) + .on 'click', (e) => + $btn = $(e.currentTarget) $btn .disable() .addClass 'is-loading' - $(".js-add-to-import").each -> + $('.js-add-to-import').each -> $(this).click() setAutoUpdate: -> -- cgit v1.2.1 From 65410e63ac8c2e4e25acabb73ede6a2dfdc3d829 Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Thu, 14 Apr 2016 10:15:38 +0100 Subject: Variable name --- app/assets/javascripts/importer_status.js.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/assets') diff --git a/app/assets/javascripts/importer_status.js.coffee b/app/assets/javascripts/importer_status.js.coffee index 95f9f86c0ad..2eb151a641b 100644 --- a/app/assets/javascripts/importer_status.js.coffee +++ b/app/assets/javascripts/importer_status.js.coffee @@ -6,9 +6,9 @@ class @ImporterStatus initStatusPage: -> $('.js-add-to-import') .off 'click' - .on 'click', (event) => + .on 'click', (e) => new_namespace = null - $btn = $(event.currentTarget) + $btn = $(e.currentTarget) $tr = $btn.closest('tr') id = $tr.attr('id').replace('repo_', '') if $tr.find('.import-target input').length > 0 -- cgit v1.2.1 From e490a54105b6c820e330514aeb91d004997b031c Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Thu, 14 Apr 2016 14:50:48 +0100 Subject: Discussion notes update At the moment discussion notes are rendered in a list but arent actually a list item and that can cause overflow issues Moved the dates to be in the header like other notes Fixed overlapping issue on mobile --- app/assets/stylesheets/framework/timeline.scss | 3 +-- app/assets/stylesheets/pages/notes.scss | 6 ++++++ 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'app/assets') diff --git a/app/assets/stylesheets/framework/timeline.scss b/app/assets/stylesheets/framework/timeline.scss index b91f2f6f898..f0ec250de2b 100644 --- a/app/assets/stylesheets/framework/timeline.scss +++ b/app/assets/stylesheets/framework/timeline.scss @@ -39,8 +39,7 @@ .diff-file { border: 1px solid $border-color; border-bottom: none; - margin-left: 0; - margin-right: 0; + margin: 0; } } diff --git a/app/assets/stylesheets/pages/notes.scss b/app/assets/stylesheets/pages/notes.scss index e421a31549a..7489d5de5f0 100644 --- a/app/assets/stylesheets/pages/notes.scss +++ b/app/assets/stylesheets/pages/notes.scss @@ -198,6 +198,12 @@ ul.notes { color: $notes-light-color; } +.discussion-headline-light { + a { + color: $gl-link-color; + } +} + /** * Actions for Discussions/Notes */ -- cgit v1.2.1 From 44f3f42bac143f87d756ed38fa7142f98c7be90d Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Thu, 14 Apr 2016 14:56:05 +0100 Subject: Dicussion action mobile fix --- app/assets/stylesheets/pages/notes.scss | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'app/assets') diff --git a/app/assets/stylesheets/pages/notes.scss b/app/assets/stylesheets/pages/notes.scss index 7489d5de5f0..e4f96c11aae 100644 --- a/app/assets/stylesheets/pages/notes.scss +++ b/app/assets/stylesheets/pages/notes.scss @@ -215,6 +215,17 @@ ul.notes { color: $notes-action-color; } +.discussion-actions { + @media (max-width: $screen-sm-max) { + float: none; + margin-left: 0; + + .note-action-button { + margin-left: 0; + } + } +} + .note-action-button, .discussion-action-button { display: inline-block; -- cgit v1.2.1 From 01f70fc97b887dcbab8d859d2fc6ded28a2c3718 Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Thu, 14 Apr 2016 15:07:38 +0100 Subject: Fixed issue with commit time not using timeago --- app/assets/javascripts/application.js.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/assets') diff --git a/app/assets/javascripts/application.js.coffee b/app/assets/javascripts/application.js.coffee index 6f435e4c542..5bac8eef1cb 100644 --- a/app/assets/javascripts/application.js.coffee +++ b/app/assets/javascripts/application.js.coffee @@ -174,7 +174,7 @@ $ -> $('.trigger-submit').on 'change', -> $(@).parents('form').submit() - gl.utils.localTimeAgo($('abbr.timeago, .js-timeago'), false) + gl.utils.localTimeAgo($('abbr.timeago, .js-timeago'), true) # Flash if (flash = $(".flash-container")).length > 0 -- cgit v1.2.1 From 101f57d9170f5ea8e736f17c2fd8294bbc15e142 Mon Sep 17 00:00:00 2001 From: Annabel Dunstone Date: Thu, 14 Apr 2016 16:26:48 -0500 Subject: Wrap code in parallel view --- app/assets/stylesheets/pages/notes.scss | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'app/assets') diff --git a/app/assets/stylesheets/pages/notes.scss b/app/assets/stylesheets/pages/notes.scss index e421a31549a..21eca0a036e 100644 --- a/app/assets/stylesheets/pages/notes.scss +++ b/app/assets/stylesheets/pages/notes.scss @@ -171,6 +171,11 @@ ul.notes { &.parallel { border-width: 1px; + + .code, + code { + white-space: pre-wrap; + } } .notes { -- cgit v1.2.1 From fcf0612f38b719212a7b40cdaf6b026f5b5f59e7 Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Fri, 15 Apr 2016 09:47:46 +0100 Subject: Updated note form focus to better match form-control focus --- app/assets/stylesheets/pages/note_form.scss | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'app/assets') diff --git a/app/assets/stylesheets/pages/note_form.scss b/app/assets/stylesheets/pages/note_form.scss index 07c707e7b77..c2371d79989 100644 --- a/app/assets/stylesheets/pages/note_form.scss +++ b/app/assets/stylesheets/pages/note_form.scss @@ -61,11 +61,11 @@ padding: $gl-padding-top $gl-padding; border: 1px solid $note-form-border-color; border-radius: $border-radius-base; + transition: border-color ease-in-out 0.15s, + box-shadow ease-in-out 0.15s; &.is-focused { - border-color: $focus-border-color; - box-shadow: 0 0 2px $black-transparent, - 0 0 4px rgba($focus-border-color, .4); + @extend .form-control:focus; .comment-toolbar, .nav-links { -- cgit v1.2.1 From 2c5ab1b61f3b75298381e3258e303322c58f4808 Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Fri, 15 Apr 2016 18:24:16 +0100 Subject: Removes dropzone focus class after dropping file --- app/assets/javascripts/dropzone_input.js.coffee | 1 + 1 file changed, 1 insertion(+) (limited to 'app/assets') diff --git a/app/assets/javascripts/dropzone_input.js.coffee b/app/assets/javascripts/dropzone_input.js.coffee index 6eb8d27ee2b..e2194589b38 100644 --- a/app/assets/javascripts/dropzone_input.js.coffee +++ b/app/assets/javascripts/dropzone_input.js.coffee @@ -61,6 +61,7 @@ class @DropzoneInput return drop: -> + $mdArea.removeClass 'is-dropzone-hover' form.find(".div-dropzone-hover").css "opacity", 0 form_textarea.focus() return -- cgit v1.2.1 From f2d94c5d8627adee985e605a18cf147003ef16de Mon Sep 17 00:00:00 2001 From: Jacob Schatz Date: Fri, 15 Apr 2016 16:05:37 -0400 Subject: Scroll to the last comment I made and edit it. --- app/assets/javascripts/notes.js.coffee | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) (limited to 'app/assets') diff --git a/app/assets/javascripts/notes.js.coffee b/app/assets/javascripts/notes.js.coffee index fa91baa07c0..a3d0d212bed 100644 --- a/app/assets/javascripts/notes.js.coffee +++ b/app/assets/javascripts/notes.js.coffee @@ -75,6 +75,9 @@ class @Notes # when issue status changes, we need to refresh data $(document).on "issuable:change", @refresh + # when a key is clicked on the notes + $(document).on "keydown", ".js-note-text", @keydownNoteText + cleanBinding: -> $(document).off "ajax:success", ".js-main-target-form" $(document).off "ajax:success", ".js-discussion-note-form" @@ -92,10 +95,19 @@ class @Notes $(document).off "click", ".js-note-target-reopen" $(document).off "click", ".js-note-target-close" $(document).off "click", ".js-note-discard" + $(document).off "keydown", ".js-note-text" $('.note .js-task-list-container').taskList('disable') $(document).off 'tasklist:changed', '.note .js-task-list-container' + keydownNoteText: (e) -> + $this = $(this) + if $this.val() is '' and e.which is 38 #aka the up key + myLastNote = $("li.note[data-author-id='#{gon.current_user_id}'][data-editable]:last") + if myLastNote.length + myLastNoteEditBtn = myLastNote.find('.js-note-edit') + myLastNoteEditBtn.trigger('click', [true, myLastNote]) + initRefresh: -> clearInterval(Notes.interval) Notes.interval = setInterval => @@ -343,7 +355,7 @@ class @Notes Adds a hidden div with the original content of the note to fill the edit note form with if the user cancels ### - showEditForm: (e) -> + showEditForm: (e, scrollTo, myLastNote) -> e.preventDefault() note = $(this).closest(".note") note.addClass "is-editting" @@ -355,8 +367,17 @@ class @Notes note.find(".js-note-attachment-delete").show() new GLForm form - - form.find(".js-note-text").focus() + if scrollTo? and myLastNote? + # scroll to the bottom + # so the open of the last element doesn't make a jump + $('html, body').scrollTop($(document).height()); + $('html, body').animate({ + scrollTop: myLastNote.offset().top - 150 + }, 500, -> + form.find(".js-note-text").focus() + ); + else + form.find(".js-note-text").focus() ### Called in response to clicking the edit note link -- cgit v1.2.1 From 262ca7b651037e02d0de662b6462fe4edfa77e81 Mon Sep 17 00:00:00 2001 From: Jacob Schatz Date: Fri, 15 Apr 2016 16:36:25 -0400 Subject: When editing put the cursor at the end of the textarea --- app/assets/javascripts/notes.js.coffee | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'app/assets') diff --git a/app/assets/javascripts/notes.js.coffee b/app/assets/javascripts/notes.js.coffee index a3d0d212bed..c2e103ff857 100644 --- a/app/assets/javascripts/notes.js.coffee +++ b/app/assets/javascripts/notes.js.coffee @@ -374,7 +374,11 @@ class @Notes $('html, body').animate({ scrollTop: myLastNote.offset().top - 150 }, 500, -> - form.find(".js-note-text").focus() + $noteText = form.find(".js-note-text") + $noteText.focus() + # Neat little trick to put the cursor at the end + noteTextVal = $noteText.val() + $noteText.val('').val(noteTextVal); ); else form.find(".js-note-text").focus() -- cgit v1.2.1 From 16459fddd4857bc18a917e13989b755468cfd7e8 Mon Sep 17 00:00:00 2001 From: Alfredo Sumaran Date: Wed, 30 Mar 2016 15:19:56 -0500 Subject: Fixes multiple ajax request and incorrect data being set for the current issuable --- app/assets/javascripts/gfm_auto_complete.js.coffee | 63 ++++++++++++++++------ 1 file changed, 47 insertions(+), 16 deletions(-) (limited to 'app/assets') diff --git a/app/assets/javascripts/gfm_auto_complete.js.coffee b/app/assets/javascripts/gfm_auto_complete.js.coffee index 4718bcf7a1e..61e3f811e73 100644 --- a/app/assets/javascripts/gfm_auto_complete.js.coffee +++ b/app/assets/javascripts/gfm_auto_complete.js.coffee @@ -2,6 +2,8 @@ window.GitLab ?= {} GitLab.GfmAutoComplete = + dataLoading: false + dataSource: '' # Emoji @@ -17,17 +19,41 @@ GitLab.GfmAutoComplete = template: '
  • ${id} ${title}
  • ' # Add GFM auto-completion to all input fields, that accept GFM input. - setup: -> - input = $('.js-gfm-input') + setup: (wrap) -> + @input = $('.js-gfm-input') + + # destroy previous instances + @destroyAtWho() + + # set up instances + @setupAtWho() + + if @dataSource + if !@dataLoading + @dataLoading = true + # We should wait until initializations are done + # and only trigger the last .setup since + # The previous .dataSource belongs to the previous issuable + # and the last one will have the **proper** .dataSource property + # TODO: Make this a singleton and turn off events when moving to another page + setTimeout( => + fetch = @fetchData(@dataSource) + fetch.done (data) => + @dataLoading = false + @loadData(data) + , 1000) + + + setupAtWho: -> # Emoji - input.atwho + @input.atwho at: ':' displayTpl: @Emoji.template insertTpl: ':${name}:' # Team Members - input.atwho + @input.atwho at: '@' displayTpl: @Members.template insertTpl: '${atwho-at}${username}' @@ -42,7 +68,7 @@ GitLab.GfmAutoComplete = title: sanitize(title) search: sanitize("#{m.username} #{m.name}") - input.atwho + @input.atwho at: '#' alias: 'issues' searchKey: 'search' @@ -55,7 +81,7 @@ GitLab.GfmAutoComplete = title: sanitize(i.title) search: "#{i.iid} #{i.title}" - input.atwho + @input.atwho at: '!' alias: 'mergerequests' searchKey: 'search' @@ -68,13 +94,18 @@ GitLab.GfmAutoComplete = title: sanitize(m.title) search: "#{m.iid} #{m.title}" - if @dataSource - $.getJSON(@dataSource).done (data) -> - # load members - input.atwho 'load', '@', data.members - # load issues - input.atwho 'load', 'issues', data.issues - # load merge requests - input.atwho 'load', 'mergerequests', data.mergerequests - # load emojis - input.atwho 'load', ':', data.emojis + destroyAtWho: -> + @input.atwho('destroy') + + fetchData: (dataSource) -> + $.getJSON(dataSource) + + loadData: (data) -> + # load members + @input.atwho 'load', '@', data.members + # load issues + @input.atwho 'load', 'issues', data.issues + # load merge requests + @input.atwho 'load', 'mergerequests', data.mergerequests + # load emojis + @input.atwho 'load', ':', data.emojis -- cgit v1.2.1 From dd0478656d877bea84a313826258f1a35f9b1ab4 Mon Sep 17 00:00:00 2001 From: Jacob Schatz Date: Sat, 16 Apr 2016 16:08:53 -0400 Subject: Add move cursor to last character for editing comment also. --- app/assets/javascripts/notes.js.coffee | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'app/assets') diff --git a/app/assets/javascripts/notes.js.coffee b/app/assets/javascripts/notes.js.coffee index c2e103ff857..82e210fed7d 100644 --- a/app/assets/javascripts/notes.js.coffee +++ b/app/assets/javascripts/notes.js.coffee @@ -366,6 +366,11 @@ class @Notes # Show the attachment delete link note.find(".js-note-attachment-delete").show() + done = ($noteText) -> + # Neat little trick to put the cursor at the end + noteTextVal = $noteText.val() + $noteText.val('').val(noteTextVal); + new GLForm form if scrollTo? and myLastNote? # scroll to the bottom @@ -376,12 +381,12 @@ class @Notes }, 500, -> $noteText = form.find(".js-note-text") $noteText.focus() - # Neat little trick to put the cursor at the end - noteTextVal = $noteText.val() - $noteText.val('').val(noteTextVal); + done($noteText) ); else - form.find(".js-note-text").focus() + $noteText = form.find('.js-note-text') + $noteText.focus() + done($noteText) ### Called in response to clicking the edit note link -- cgit v1.2.1 From fd42b0db02f7911c9aa1a1b0656b6547ad2c0841 Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Fri, 1 Apr 2016 11:55:26 +0100 Subject: Refactored issue header to work better for mobile This will also work better for when the title makes the buttons drop down a new line Closes #14228 --- app/assets/stylesheets/framework/issue_box.scss | 2 +- app/assets/stylesheets/framework/mobile.scss | 7 ---- app/assets/stylesheets/pages/detail_page.scss | 5 --- app/assets/stylesheets/pages/issuable.scss | 51 +++++++++++++++++++++++-- app/assets/stylesheets/pages/issues.scss | 40 ------------------- 5 files changed, 48 insertions(+), 57 deletions(-) (limited to 'app/assets') diff --git a/app/assets/stylesheets/framework/issue_box.scss b/app/assets/stylesheets/framework/issue_box.scss index 7f7b7c806e7..8bfc0d583c5 100644 --- a/app/assets/stylesheets/framework/issue_box.scss +++ b/app/assets/stylesheets/framework/issue_box.scss @@ -5,7 +5,7 @@ */ .status-box { - + /* Extra small devices (phones, less than 768px) */ /* No media query since this is the default in Bootstrap */ padding: 5px 11px; diff --git a/app/assets/stylesheets/framework/mobile.scss b/app/assets/stylesheets/framework/mobile.scss index 66180f38a4f..7eb451c124e 100644 --- a/app/assets/stylesheets/framework/mobile.scss +++ b/app/assets/stylesheets/framework/mobile.scss @@ -70,13 +70,6 @@ display: none; } - .issue-details { - .creator, - .page-title .btn-close { - display: none; - } - } - %ul.notes .note-role, .note-actions { display: none; } diff --git a/app/assets/stylesheets/pages/detail_page.scss b/app/assets/stylesheets/pages/detail_page.scss index 5917f089720..89bdb9ae03e 100644 --- a/app/assets/stylesheets/pages/detail_page.scss +++ b/app/assets/stylesheets/pages/detail_page.scss @@ -16,11 +16,6 @@ .issue_created_ago, .author_link { white-space: nowrap; } - - .issue-meta { - display: inline-block; - line-height: 20px; - } } .detail-page-description { diff --git a/app/assets/stylesheets/pages/issuable.scss b/app/assets/stylesheets/pages/issuable.scss index 6bd90a23620..5bf44c1cdb6 100644 --- a/app/assets/stylesheets/pages/issuable.scss +++ b/app/assets/stylesheets/pages/issuable.scss @@ -273,10 +273,6 @@ } } -.btn-default.gutter-toggle { - margin-top: 4px; -} - .detail-page-description { small { color: $gray-darkest; @@ -322,3 +318,50 @@ padding-top: 7px; } } + +.issuable-status-box { + float: none; + display: inline-block; + margin-top: 0; + + @media (max-width: $screen-xs-max) { + position: absolute; + top: 0; + left: 0; + } +} + +.issuable-header { + position: relative; + padding-left: 45px; + padding-right: 45px; + line-height: 35px; + + @media (min-width: $screen-sm-min) { + float: left; + padding-left: 0; + padding-right: 0; + } +} + +.issuable-actions { + padding-top: 10px; + + @media (min-width: $screen-sm-min) { + float: right; + padding-top: 0; + } +} + +.issuable-gutter-toggle { + @media (max-width: $screen-sm-max) { + position: absolute; + top: 0; + right: 0; + } +} + +.issuable-meta { + display: inline-block; + line-height: 18px; +} diff --git a/app/assets/stylesheets/pages/issues.scss b/app/assets/stylesheets/pages/issues.scss index 6a1d28590c2..fc9db97132d 100644 --- a/app/assets/stylesheets/pages/issues.scss +++ b/app/assets/stylesheets/pages/issues.scss @@ -86,41 +86,9 @@ form.edit-issue { @media (max-width: $screen-xs-max) { .issue-btn-group { width: 100%; - margin-top: 5px; - - .btn-group { - width: 100%; - - ul { - width: 100%; - text-align: center; - } - } .btn { width: 100%; - - &:first-child:not(:last-child) { - - } - - &:not(:first-child):not(:last-child) { - margin-top: 10px; - } - - &:last-child:not(:first-child) { - margin-top: 10px; - } - } - } - - .issue { - &:hover .issue-actions { - display: none !important; - } - - .issue-updated-at { - display: none; } } } @@ -133,11 +101,3 @@ form.edit-issue { color: $gl-text-color; margin-left: 52px; } - -.editor-details { - display: block; - - @media (min-width: $screen-sm-min) { - display: inline-block; - } -} -- cgit v1.2.1 From 365f351a6c4679db8e7cda52c899d1ce14200097 Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Fri, 1 Apr 2016 14:43:42 +0100 Subject: Alignment with sidebar --- app/assets/stylesheets/pages/detail_page.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/assets') diff --git a/app/assets/stylesheets/pages/detail_page.scss b/app/assets/stylesheets/pages/detail_page.scss index 89bdb9ae03e..2c2ac903f29 100644 --- a/app/assets/stylesheets/pages/detail_page.scss +++ b/app/assets/stylesheets/pages/detail_page.scss @@ -1,5 +1,5 @@ .detail-page-header { - padding: 11px 0; + padding: $gl-padding-top 0; border-bottom: 1px solid $border-color; color: #5c5d5e; font-size: 16px; -- cgit v1.2.1 From 6f31262f747b7c1ed0173b6615ef0990967a0db6 Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Mon, 18 Apr 2016 08:48:41 +0100 Subject: Fixed overlap in header on mobile --- app/assets/stylesheets/framework/header.scss | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'app/assets') diff --git a/app/assets/stylesheets/framework/header.scss b/app/assets/stylesheets/framework/header.scss index 3f015427d07..c303380764b 100644 --- a/app/assets/stylesheets/framework/header.scss +++ b/app/assets/stylesheets/framework/header.scss @@ -71,7 +71,7 @@ header { .header-content { position: relative; height: $header-height; - padding-right: 20px; + padding-right: 40px; @media (min-width: $screen-sm-min) { padding-right: 0; @@ -122,6 +122,10 @@ header { } } + .project-item-select-holder { + display: inline; + } + .impersonation i { color: $red-normal; } -- cgit v1.2.1 From 1a57601d8cac0de35f301f8a8094c61fc94ed1cb Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Mon, 18 Apr 2016 12:00:20 +0100 Subject: Updated print style Closes #14201 --- app/assets/stylesheets/print.scss | 44 ++++++++++++++++++++++++++++----------- 1 file changed, 32 insertions(+), 12 deletions(-) (limited to 'app/assets') diff --git a/app/assets/stylesheets/print.scss b/app/assets/stylesheets/print.scss index 1be0551ad3b..a30b6492572 100644 --- a/app/assets/stylesheets/print.scss +++ b/app/assets/stylesheets/print.scss @@ -1,17 +1,37 @@ -/* Generic print styles */ -header, nav, nav.main-nav, nav.navbar-collapse, nav.navbar-collapse.collapse {display: none!important;} -.profiler-results {display: none;} - -/* Styles targeted specifically at printing files */ -.tree-ref-holder, .tree-holder .breadcrumb, .blob-commit-info {display: none;} -.file-title {display: none;} -.file-holder {border: none;} - .wiki h1, .wiki h2, .wiki h3, .wiki h4, .wiki h5, .wiki h6 {margin-top: 17px; } .wiki h1 {font-size: 30px;} .wiki h2 {font-size: 22px;} .wiki h3 {font-size: 18px; font-weight: bold; } -.sidebar-wrapper { display: none; } -.nav { display: none; } -.btn { display: none; } +header, +nav, +nav.main-nav, +nav.navbar-collapse, +nav.navbar-collapse.collapse, +.profiler-results, +.tree-ref-holder, +.tree-holder .breadcrumb, +.blob-commit-info, +.file-title, +.file-holder, +.sidebar-wrapper, +.nav, +.btn, +ul.notes-form, +.merge-request-ci-status .ci-status-link:after, +.issuable-gutter-toggle, +.gutter-toggle, +.issuable-details .content-block-small, +.edit-link, +.note-action-button { + display: none!important; +} + +.page-gutter { + padding-top: 0; + padding-left: 0; +} + +.right-sidebar { + top: 0; +} -- cgit v1.2.1 From fe3ac403b97eb8dbe45189ba3737537a536b8956 Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Mon, 18 Apr 2016 13:45:26 +0100 Subject: Addressed feedback --- app/assets/javascripts/importer_status.js.coffee | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'app/assets') diff --git a/app/assets/javascripts/importer_status.js.coffee b/app/assets/javascripts/importer_status.js.coffee index 2eb151a641b..b0edc895649 100644 --- a/app/assets/javascripts/importer_status.js.coffee +++ b/app/assets/javascripts/importer_status.js.coffee @@ -23,14 +23,14 @@ class @ImporterStatus $('.js-import-all') .off 'click' - .on 'click', (e) => - $btn = $(e.currentTarget) + .on 'click', (e) -> + $btn = $(@) $btn .disable() .addClass 'is-loading' $('.js-add-to-import').each -> - $(this).click() + $(this).trigger('click') setAutoUpdate: -> setInterval (=> -- cgit v1.2.1 From 073c3d15c71a0f877b62c7d3d7417a9721da1dba Mon Sep 17 00:00:00 2001 From: Anton Davydov Date: Tue, 1 Mar 2016 15:36:50 +0300 Subject: Initial implementation if license template selector and /licenses/:key API endpoint --- app/assets/javascripts/api.js.coffee | 13 ++++++++++++ .../blob/blob_license_selector.js.coffee | 24 ++++++++++++++++++++++ app/assets/stylesheets/pages/editor.scss | 9 ++++++++ 3 files changed, 46 insertions(+) create mode 100644 app/assets/javascripts/blob/blob_license_selector.js.coffee (limited to 'app/assets') diff --git a/app/assets/javascripts/api.js.coffee b/app/assets/javascripts/api.js.coffee index f3ed9a66715..f4757658d54 100644 --- a/app/assets/javascripts/api.js.coffee +++ b/app/assets/javascripts/api.js.coffee @@ -5,6 +5,7 @@ group_projects_path: "/api/:version/groups/:id/projects.json" projects_path: "/api/:version/projects.json" labels_path: "/api/:version/projects/:id/labels" + license_path: "/api/:version/licenses/:key" group: (group_id, callback) -> url = Api.buildUrl(Api.group_path) @@ -92,6 +93,18 @@ ).done (projects) -> callback(projects) + # Return text for specific license + licenseText: (key, fullname, callback) -> + url = Api.buildUrl(Api.license_path) + url = url.replace(':key', key) + + $.ajax( + url: url + data: + fullname: fullname + ).done (projects) -> + callback(projects) + buildUrl: (url) -> url = gon.relative_url_root + url if gon.relative_url_root? return url.replace(':version', gon.api_version) diff --git a/app/assets/javascripts/blob/blob_license_selector.js.coffee b/app/assets/javascripts/blob/blob_license_selector.js.coffee new file mode 100644 index 00000000000..b43c1ec2bb5 --- /dev/null +++ b/app/assets/javascripts/blob/blob_license_selector.js.coffee @@ -0,0 +1,24 @@ +class @BlobLicenseSelector + licenseRegex: /^(.+\/)?(licen[sc]e|copying)($|\.)/i + + constructor: (editor)-> + self = this + @licenseSelector = $('.js-license-selector') + @toggleLicenseSelector($('#file_name').val()) + + $('#file_name').on 'input', -> + self.toggleLicenseSelector($(this).val()) + + $('select.license-select').select2( + width: 'resolve' + dropdownAutoWidth: true + placeholder: 'Choose a license template' + ).on 'change', (e) -> + Api.licenseText $(this).val(), $(this).data('fullname'), (data) -> + editor.setValue(data, -1) + + toggleLicenseSelector: (fileName) => + if @licenseRegex.test(fileName) + @licenseSelector.show() + else + @licenseSelector.hide() diff --git a/app/assets/stylesheets/pages/editor.scss b/app/assets/stylesheets/pages/editor.scss index 0f0592a0ab8..8981f070a20 100644 --- a/app/assets/stylesheets/pages/editor.scss +++ b/app/assets/stylesheets/pages/editor.scss @@ -26,6 +26,10 @@ line-height: 42px; padding-top: 7px; padding-bottom: 7px; + + .pull-right { + height: 20px; + } } .editor-ref { @@ -53,4 +57,9 @@ .select2 { float: right; } + + .encoding-selector, + .license-selector { + display: inline-block; + } } -- cgit v1.2.1 From 13804aba867d19009ca94d820aa7ec650a509f5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Mon, 11 Apr 2016 15:49:25 +0200 Subject: Continue implementation of the license template selector and /licenses API endpoint MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rémy Coutable --- app/assets/javascripts/api.js.coffee | 14 ++--- .../blob/blob_license_selector.js.coffee | 36 +++++++----- app/assets/javascripts/blob/edit_blob.js.coffee | 67 ++++++++++------------ app/assets/javascripts/blob/new_blob.js.coffee | 20 ------- 4 files changed, 58 insertions(+), 79 deletions(-) delete mode 100644 app/assets/javascripts/blob/new_blob.js.coffee (limited to 'app/assets') diff --git a/app/assets/javascripts/api.js.coffee b/app/assets/javascripts/api.js.coffee index f4757658d54..dd1bbb37551 100644 --- a/app/assets/javascripts/api.js.coffee +++ b/app/assets/javascripts/api.js.coffee @@ -93,17 +93,15 @@ ).done (projects) -> callback(projects) - # Return text for specific license - licenseText: (key, fullname, callback) -> - url = Api.buildUrl(Api.license_path) - url = url.replace(':key', key) + # Return text for a specific license + licenseText: (key, data, callback) -> + url = Api.buildUrl(Api.license_path).replace(':key', key) $.ajax( url: url - data: - fullname: fullname - ).done (projects) -> - callback(projects) + data: data + ).done (license) -> + callback(license) buildUrl: (url) -> url = gon.relative_url_root + url if gon.relative_url_root? diff --git a/app/assets/javascripts/blob/blob_license_selector.js.coffee b/app/assets/javascripts/blob/blob_license_selector.js.coffee index b43c1ec2bb5..e17eaa75dc1 100644 --- a/app/assets/javascripts/blob/blob_license_selector.js.coffee +++ b/app/assets/javascripts/blob/blob_license_selector.js.coffee @@ -1,24 +1,30 @@ class @BlobLicenseSelector licenseRegex: /^(.+\/)?(licen[sc]e|copying)($|\.)/i - constructor: (editor)-> - self = this - @licenseSelector = $('.js-license-selector') - @toggleLicenseSelector($('#file_name').val()) + constructor: (editor) -> + @$licenseSelector = $('.js-license-selector') + $fileNameInput = $('#file_name') - $('#file_name').on 'input', -> - self.toggleLicenseSelector($(this).val()) + initialFileNameValue = if $fileNameInput.length + $fileNameInput.val() + else if $('.editor-file-name').length + $('.editor-file-name').text().trim() - $('select.license-select').select2( - width: 'resolve' - dropdownAutoWidth: true - placeholder: 'Choose a license template' - ).on 'change', (e) -> - Api.licenseText $(this).val(), $(this).data('fullname'), (data) -> - editor.setValue(data, -1) + @toggleLicenseSelector(initialFileNameValue) + + if $fileNameInput + $fileNameInput.on 'keyup blur', (e) => + @toggleLicenseSelector($(e.target).val()) + + $('select.license-select').on 'change', (e) -> + data = + project: $(this).data('project') + fullname: $(this).data('fullname') + Api.licenseText $(this).val(), data, (license) -> + editor.setValue(license.content, -1) toggleLicenseSelector: (fileName) => if @licenseRegex.test(fileName) - @licenseSelector.show() + @$licenseSelector.show() else - @licenseSelector.hide() + @$licenseSelector.hide() diff --git a/app/assets/javascripts/blob/edit_blob.js.coffee b/app/assets/javascripts/blob/edit_blob.js.coffee index 390e41ed8d4..eea9aa972ee 100644 --- a/app/assets/javascripts/blob/edit_blob.js.coffee +++ b/app/assets/javascripts/blob/edit_blob.js.coffee @@ -1,44 +1,39 @@ class @EditBlob - constructor: (assets_path, mode)-> - ace.config.set "modePath", assets_path + '/ace' + constructor: (assets_path, ace_mode = null) -> + ace.config.set "modePath", "#{assets_path}/ace" ace.config.loadModule "ace/ext/searchbox" - if mode - ace_mode = mode - editor = ace.edit("editor") - editor.focus() - @editor = editor - - if ace_mode - editor.getSession().setMode "ace/mode/" + ace_mode + @editor = ace.edit("editor") + @editor.focus() + @editor.getSession().setMode "ace/mode/#{ace_mode}" if ace_mode # Before a form submission, move the content from the Ace editor into the # submitted textarea - $('form').submit -> - $("#file-content").val(editor.getValue()) + $('form').submit => + $("#file-content").val(@editor.getValue()) + + @initModePanesAndLinks() + new BlobLicenseSelector(@editor) - editModePanes = $(".js-edit-mode-pane") - editModeLinks = $(".js-edit-mode a") - editModeLinks.click (event) -> - event.preventDefault() - currentLink = $(this) - paneId = currentLink.attr("href") - currentPane = editModePanes.filter(paneId) - editModeLinks.parent().removeClass "active hover" - currentLink.parent().addClass "active hover" - editModePanes.hide() - if paneId is "#preview" - currentPane.fadeIn 200 - $.post currentLink.data("preview-url"), - content: editor.getValue() - , (response) -> - currentPane.empty().append response - currentPane.syntaxHighlight() - return + initModePanesAndLinks: -> + @$editModePanes = $(".js-edit-mode-pane") + @$editModeLinks = $(".js-edit-mode a") + @$editModeLinks.click @editModeLinkClickHandler - else - currentPane.fadeIn 200 - editor.focus() - return + editModeLinkClickHandler: (event) => + event.preventDefault() + currentLink = $(event.target) + paneId = currentLink.attr("href") + currentPane = @$editModePanes.filter(paneId) + @$editModeLinks.parent().removeClass "active hover" + currentLink.parent().addClass "active hover" + @$editModePanes.hide() + currentPane.fadeIn 200 + if paneId is "#preview" + $.post currentLink.data("preview-url"), + content: @editor.getValue() + , (response) -> + currentPane.empty().append response + currentPane.syntaxHighlight() - editor: -> - return @editor + else + @editor.focus() diff --git a/app/assets/javascripts/blob/new_blob.js.coffee b/app/assets/javascripts/blob/new_blob.js.coffee deleted file mode 100644 index 68c5e5195e3..00000000000 --- a/app/assets/javascripts/blob/new_blob.js.coffee +++ /dev/null @@ -1,20 +0,0 @@ -class @NewBlob - constructor: (assets_path, mode)-> - ace.config.set "modePath", assets_path + '/ace' - ace.config.loadModule "ace/ext/searchbox" - if mode - ace_mode = mode - editor = ace.edit("editor") - editor.focus() - @editor = editor - - if ace_mode - editor.getSession().setMode "ace/mode/" + ace_mode - - # Before a form submission, move the content from the Ace editor into the - # submitted textarea - $('form').submit -> - $("#file-content").val(editor.getValue()) - - editor: -> - return @editor -- cgit v1.2.1 From ea7114541838652fe3e6dcf3bdc4c3812f013e7b Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Mon, 18 Apr 2016 16:45:49 +0100 Subject: Fixed issue with multi select not working with arrow keys --- app/assets/javascripts/gl_dropdown.js.coffee | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'app/assets') diff --git a/app/assets/javascripts/gl_dropdown.js.coffee b/app/assets/javascripts/gl_dropdown.js.coffee index 2dc37257e22..fac928ef202 100644 --- a/app/assets/javascripts/gl_dropdown.js.coffee +++ b/app/assets/javascripts/gl_dropdown.js.coffee @@ -32,10 +32,8 @@ class GitLabDropdownFilter else if @input.val() is "" and $inputContainer.hasClass HAS_VALUE_CLASS $inputContainer.removeClass HAS_VALUE_CLASS - if keyCode is 13 and @input.val() isnt "" - if @options.enterCallback - @options.enterCallback() - return + if keyCode is 13 + return false clearTimeout timeout timeout = setTimeout => @@ -132,7 +130,6 @@ class GitLabDropdown @filterInput = @getElement(FILTER_INPUT) @highlight = false @filterInputBlur = true - @enterCallback = true } = @options self = @ @@ -178,9 +175,6 @@ class GitLabDropdown callback: (data) => currentIndex = -1 @parseData data - enterCallback: => - if @enterCallback - @selectRowAtIndex 0 # Event listeners -- cgit v1.2.1 From 872d31d6e9566f55f9eadd12d496d07e86c13f0a Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Mon, 18 Apr 2016 16:56:48 +0100 Subject: Fixed issue with spinner not hiding on diff changes --- app/assets/javascripts/merge_request_tabs.js.coffee | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'app/assets') diff --git a/app/assets/javascripts/merge_request_tabs.js.coffee b/app/assets/javascripts/merge_request_tabs.js.coffee index 1ab6e5114bc..e8613cab72b 100644 --- a/app/assets/javascripts/merge_request_tabs.js.coffee +++ b/app/assets/javascripts/merge_request_tabs.js.coffee @@ -183,9 +183,10 @@ class @MergeRequestTabs else $diffLine = $('td', $diffLine) - $diffLine.addClass 'hll' - diffLineTop = $diffLine.offset().top - navBarHeight = $('.navbar-gitlab').outerHeight() + if $diffLine.length + $diffLine.addClass 'hll' + diffLineTop = $diffLine.offset().top + navBarHeight = $('.navbar-gitlab').outerHeight() loadBuilds: (source) -> return if @buildsLoaded -- cgit v1.2.1 From beb32f31fba16e84c6bcfb59d538379db2d2a842 Mon Sep 17 00:00:00 2001 From: Annabel Dunstone Date: Mon, 18 Apr 2016 13:04:36 -0500 Subject: Add null check to formData.append --- app/assets/javascripts/profile.js.coffee | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'app/assets') diff --git a/app/assets/javascripts/profile.js.coffee b/app/assets/javascripts/profile.js.coffee index f4a2562885d..26a12423521 100644 --- a/app/assets/javascripts/profile.js.coffee +++ b/app/assets/javascripts/profile.js.coffee @@ -45,9 +45,10 @@ class @Profile saveForm: -> self = @ - formData = new FormData(@form[0]) - formData.append('user[avatar]', @avatarGlCrop.getBlob(), 'avatar.png') + + avatarBlob = @avatarGlCrop.getBlob() + formData.append('user[avatar]', avatarBlob, 'avatar.png') if avatarBlob? $.ajax url: @form.attr('action') -- cgit v1.2.1 From d1b2e7b440e03e9ad5cac72fe767b16bf11d05cc Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Tue, 19 Apr 2016 10:26:07 +0100 Subject: Trigger filtering after ajax is complete in dropdown Closes #15186 --- app/assets/javascripts/gl_dropdown.js.coffee | 3 +++ 1 file changed, 3 insertions(+) (limited to 'app/assets') diff --git a/app/assets/javascripts/gl_dropdown.js.coffee b/app/assets/javascripts/gl_dropdown.js.coffee index fac928ef202..641141072f4 100644 --- a/app/assets/javascripts/gl_dropdown.js.coffee +++ b/app/assets/javascripts/gl_dropdown.js.coffee @@ -154,6 +154,9 @@ class GitLabDropdown @fullData = data @parseData @fullData + + if @options.filterable + @filterInput.trigger 'keyup' } # Init filterable -- cgit v1.2.1 From 114d3c9846a7cb7085f881bc856f7fa6d307dc57 Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Tue, 19 Apr 2016 14:32:21 +0100 Subject: Fixed issue with sidebar edit links toggling anchor This caused an issue with the page scrolling from the bottom to the top. Also stopped the dropdown links doing the same. --- app/assets/javascripts/issuable_context.js.coffee | 39 ++++++++++++++--------- 1 file changed, 24 insertions(+), 15 deletions(-) (limited to 'app/assets') diff --git a/app/assets/javascripts/issuable_context.js.coffee b/app/assets/javascripts/issuable_context.js.coffee index 2f19513a831..9ae0cd06039 100644 --- a/app/assets/javascripts/issuable_context.js.coffee +++ b/app/assets/javascripts/issuable_context.js.coffee @@ -9,21 +9,30 @@ class @IssuableContext $(".issuable-sidebar .inline-update").on "change", ".js-assignee", -> $(this).submit() - $(document).off("click", ".edit-link").on "click",".edit-link", (e) -> - $block = $(@).parents('.block') - $selectbox = $block.find('.selectbox') - if $selectbox.is(':visible') - $selectbox.hide() - $block.find('.value').show() - else - $selectbox.show() - $block.find('.value').hide() - - if $selectbox.is(':visible') - setTimeout (-> - $block.find('.dropdown-menu-toggle').trigger 'click' - ), 0 - + $(document) + .off 'click', '.dropdown-content a' + .on 'click', '.dropdown-content a', (e) -> + e.preventDefault() + + $(document) + .off 'click', '.edit-link' + .on 'click', '.edit-link', (e) -> + e.preventDefault() + + $block = $(@).parents('.block') + $selectbox = $block.find('.selectbox') + if $selectbox.is(':visible') + $selectbox.hide() + $block.find('.value').show() + else + $selectbox.show() + $block.find('.value').hide() + + if $selectbox.is(':visible') + setTimeout -> + $block.find('.dropdown-menu-toggle').trigger 'click' + , 0 + $(".right-sidebar").niceScroll() -- cgit v1.2.1 From 8de18d417d43807fe329082c0666813af7c3d9ea Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Tue, 19 Apr 2016 13:41:08 -0400 Subject: Remove XSS vulnerability in Label and Milestone dropdowns --- app/assets/javascripts/labels_select.js.coffee | 10 +++++----- app/assets/javascripts/milestone_select.js.coffee | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'app/assets') diff --git a/app/assets/javascripts/labels_select.js.coffee b/app/assets/javascripts/labels_select.js.coffee index bc80980acb7..1131492b7ae 100644 --- a/app/assets/javascripts/labels_select.js.coffee +++ b/app/assets/javascripts/labels_select.js.coffee @@ -33,13 +33,13 @@ class @LabelsSelect if issueUpdateURL labelHTMLTemplate = _.template( '<% _.each(labels, function(label){ %> - issues?label_name=<%= label.title %>"> - - <%= label.title %> + issues?label_name=<%= _.escape(label.title) %>"> + + <%= _.escape(label.title) %> <% }); %>' - ); + ) labelNoneHTMLTemplate = _.template('
    None
    ') if newLabelField.length and $dropdown.hasClass 'js-extra-options' @@ -211,7 +211,7 @@ class @LabelsSelect "
  • #{color} - #{label.title} + #{_.escape(label.title)}
  • " filterable: true diff --git a/app/assets/javascripts/milestone_select.js.coffee b/app/assets/javascripts/milestone_select.js.coffee index 6bd4e885a03..04fd5cf37bd 100644 --- a/app/assets/javascripts/milestone_select.js.coffee +++ b/app/assets/javascripts/milestone_select.js.coffee @@ -24,7 +24,7 @@ class @MilestoneSelect if issueUpdateURL milestoneLinkTemplate = _.template( - '<%= title %>' + '<%= _.escape(title) %>' ) milestoneLinkNoneTemplate = '
    None
    ' @@ -71,7 +71,7 @@ class @MilestoneSelect defaultLabel fieldName: $dropdown.data('field-name') text: (milestone) -> - milestone.title + _.escape(milestone.title) id: (milestone) -> if !useId milestone.name -- cgit v1.2.1 From 98b1c77e24f8f7e8a15de276b29f0c3b36b9990e Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Wed, 20 Apr 2016 14:44:27 +0100 Subject: Fixes issue with note form inheriting text color --- app/assets/stylesheets/pages/note_form.scss | 1 + 1 file changed, 1 insertion(+) (limited to 'app/assets') diff --git a/app/assets/stylesheets/pages/note_form.scss b/app/assets/stylesheets/pages/note_form.scss index c2371d79989..2f6d172568b 100644 --- a/app/assets/stylesheets/pages/note_form.scss +++ b/app/assets/stylesheets/pages/note_form.scss @@ -42,6 +42,7 @@ .note-textarea { display: block; padding: 10px 0; + color: $gl-gray; font-family: $regular_font; border: 0; -- cgit v1.2.1