From aeb6d2287b8a858a84f024c6dff8e39298ed281f Mon Sep 17 00:00:00 2001 From: Steffen van Bergerem Date: Sat, 7 Jan 2017 18:59:57 +0100 Subject: [PATCH 1/4] Remove unused upload button css closes #7271 --- app/assets/stylesheets/publisher.scss | 5 ----- 1 file changed, 5 deletions(-) diff --git a/app/assets/stylesheets/publisher.scss b/app/assets/stylesheets/publisher.scss index 2504f8d34..51c4a494f 100644 --- a/app/assets/stylesheets/publisher.scss +++ b/app/assets/stylesheets/publisher.scss @@ -274,11 +274,6 @@ padding: 4px 2px; text-decoration: none; i { color: $text-grey; } - - [type='file'], - [type='file']::-webkit-file-upload-button { - cursor: pointer; - } } .btn.btn-link:hover { From 95ddae86c74047460c1806d9307b4c327f42264a Mon Sep 17 00:00:00 2001 From: Steffen van Bergerem Date: Fri, 9 Dec 2016 19:28:08 +0100 Subject: [PATCH 2/4] Bump autosize --- Gemfile | 2 +- Gemfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 0c25a8dc9..3ae7baf9b 100644 --- a/Gemfile +++ b/Gemfile @@ -112,7 +112,7 @@ source "https://rails-assets.org" do gem "rails-assets-jquery-placeholder", "2.3.1" gem "rails-assets-jquery-textchange", "0.2.3" gem "rails-assets-perfect-scrollbar", "0.6.12" - gem "rails-assets-autosize", "3.0.17" + gem "rails-assets-autosize", "3.0.20" gem "rails-assets-blueimp-gallery", "2.21.3" end diff --git a/Gemfile.lock b/Gemfile.lock index 63b87bd2c..7528defe7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -640,7 +640,7 @@ GEM bundler (>= 1.3.0, < 2.0) railties (= 4.2.7.1) sprockets-rails - rails-assets-autosize (3.0.17) + rails-assets-autosize (3.0.20) rails-assets-blueimp-gallery (2.21.3) rails-assets-bootstrap (3.3.7) rails-assets-jquery (>= 1.9.1, < 4) @@ -997,7 +997,7 @@ DEPENDENCIES rack-rewrite (= 1.5.1) rack-ssl (= 1.4.1) rails (= 4.2.7.1) - rails-assets-autosize (= 3.0.17)! + rails-assets-autosize (= 3.0.20)! rails-assets-blueimp-gallery (= 2.21.3)! rails-assets-bootstrap-markdown (= 2.10.0)! rails-assets-corejs-typeahead (= 1.0.1)! From fb06d03f493b09d0488f684a24b53e0e2dc77966 Mon Sep 17 00:00:00 2001 From: Steffen van Bergerem Date: Fri, 9 Dec 2016 20:28:52 +0100 Subject: [PATCH 3/4] Close modals at the end of each jasmine spec closes #7246 --- Changelog.md | 1 + spec/javascripts/app/views/profile_header_view_spec.js | 4 ++-- spec/javascripts/jasmine_helpers/SpecHelper.js | 3 +++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Changelog.md b/Changelog.md index c4232da02..e532fb476 100644 --- a/Changelog.md +++ b/Changelog.md @@ -6,6 +6,7 @@ ## Bug fixes * Fix background color of year on notifications page with dark theme [#7263](https://github.com/diaspora/diaspora/pull/7263) +* Fix jasmine tests in firefox [#7246](https://github.com/diaspora/diaspora/pull/7246) ## Features * Add links to the aspects and followed tags pages on mobile [#7265](https://github.com/diaspora/diaspora/pull/7265) diff --git a/spec/javascripts/app/views/profile_header_view_spec.js b/spec/javascripts/app/views/profile_header_view_spec.js index ebd4ecde1..999d56cd6 100644 --- a/spec/javascripts/app/views/profile_header_view_spec.js +++ b/spec/javascripts/app/views/profile_header_view_spec.js @@ -61,7 +61,7 @@ describe("app.views.ProfileHeader", function() { describe("showMessageModal", function() { beforeEach(function() { - spec.content().append("
"); + spec.content().append(""); }); it("calls app.helpers.showModal", function() { @@ -78,8 +78,8 @@ describe("app.views.ProfileHeader", function() { ]; spyOn(app.views.ConversationsForm.prototype, "initialize"); + spyOn($.fn, "load").and.callFake(function(url, callback) { callback(); }); this.view.showMessageModal(); - $("#conversationModal").trigger("modal:loaded"); expect(app.views.ConversationsForm.prototype.initialize) .toHaveBeenCalledWith({prefill: gon.conversationPrefill}); }); diff --git a/spec/javascripts/jasmine_helpers/SpecHelper.js b/spec/javascripts/jasmine_helpers/SpecHelper.js index 7fa076858..67d167c16 100644 --- a/spec/javascripts/jasmine_helpers/SpecHelper.js +++ b/spec/javascripts/jasmine_helpers/SpecHelper.js @@ -78,8 +78,11 @@ afterEach(function() { jasmine.clock().uninstall(); jasmine.Ajax.uninstall(); + $(".modal").removeClass("fade").modal("hide"); $("#jasmine_content").empty(); expect(spec.loadFixtureCount).toBeLessThan(2); + expect($(".modal-backdrop").length).toBe(0); + $(".modal-backdrop").remove(); spec.loadFixtureCount = 0; }); From 5efb4a912ee2d693bdcb1580cf9acb9fe663f89b Mon Sep 17 00:00:00 2001 From: Steffen van Bergerem Date: Thu, 15 Dec 2016 11:38:14 +0100 Subject: [PATCH 4/4] Prevent scroll to top when clicking 'mark all as read' in the notification dropdown Fixes #7252 closes #7253 --- Changelog.md | 1 + app/assets/javascripts/app/views/notifications_view.js | 3 ++- spec/javascripts/app/views/notifications_view_spec.js | 9 ++++++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Changelog.md b/Changelog.md index e532fb476..9cbe3091b 100644 --- a/Changelog.md +++ b/Changelog.md @@ -7,6 +7,7 @@ ## Bug fixes * Fix background color of year on notifications page with dark theme [#7263](https://github.com/diaspora/diaspora/pull/7263) * Fix jasmine tests in firefox [#7246](https://github.com/diaspora/diaspora/pull/7246) +* Prevent scroll to top when clicking 'mark all as read' in the notification dropdown [#7253](https://github.com/diaspora/diaspora/pull/7253) ## Features * Add links to the aspects and followed tags pages on mobile [#7265](https://github.com/diaspora/diaspora/pull/7265) diff --git a/app/assets/javascripts/app/views/notifications_view.js b/app/assets/javascripts/app/views/notifications_view.js index 3ae156348..472dafbbf 100644 --- a/app/assets/javascripts/app/views/notifications_view.js +++ b/app/assets/javascripts/app/views/notifications_view.js @@ -28,7 +28,8 @@ app.views.Notifications = Backbone.View.extend({ } }, - markAllRead: function() { + markAllRead: function(evt) { + evt.preventDefault(); this.collection.setAllRead(); }, diff --git a/spec/javascripts/app/views/notifications_view_spec.js b/spec/javascripts/app/views/notifications_view_spec.js index d83770300..4e520a57c 100644 --- a/spec/javascripts/app/views/notifications_view_spec.js +++ b/spec/javascripts/app/views/notifications_view_spec.js @@ -168,9 +168,16 @@ describe("app.views.Notifications", function() { describe("markAllRead", function() { it("calls collection#setAllRead", function() { spyOn(this.collection, "setAllRead"); - this.view.markAllRead(); + this.view.markAllRead($.Event()); expect(this.collection.setAllRead).toHaveBeenCalled(); }); + + it("calls preventDefault", function() { + var evt = $.Event(); + spyOn(evt, "preventDefault"); + this.view.markAllRead(evt); + expect(evt.preventDefault).toHaveBeenCalled(); + }); }); describe("onChangedUnreadStatus", function() {