Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
3fc89919
Commit
3fc89919
authored
Aug 10, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed global use of breakpoint checker
parent
61033b2d
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
18 additions
and
34 deletions
+18
-34
app/assets/javascripts/boards/components/modal/list.js
app/assets/javascripts/boards/components/modal/list.js
+1
-1
app/assets/javascripts/breakpoints.js
app/assets/javascripts/breakpoints.js
+0
-4
app/assets/javascripts/build.js
app/assets/javascripts/build.js
+2
-5
app/assets/javascripts/fly_out_nav.js
app/assets/javascripts/fly_out_nav.js
+1
-2
app/assets/javascripts/issuable_context.js
app/assets/javascripts/issuable_context.js
+1
-2
app/assets/javascripts/main.js
app/assets/javascripts/main.js
+1
-2
app/assets/javascripts/merge_request_tabs.js
app/assets/javascripts/merge_request_tabs.js
+4
-5
app/assets/javascripts/monitoring/components/monitoring_column.vue
...s/javascripts/monitoring/components/monitoring_column.vue
+2
-3
app/assets/javascripts/new_sidebar.js
app/assets/javascripts/new_sidebar.js
+1
-2
app/assets/javascripts/wikis.js
app/assets/javascripts/wikis.js
+4
-7
spec/javascripts/fly_out_nav_spec.js
spec/javascripts/fly_out_nav_spec.js
+1
-1
No files found.
app/assets/javascripts/boards/components/modal/list.js
View file @
3fc89919
/* global ListIssue */
/* global ListIssue */
/* global bp */
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
import
bp
from
'
../../../breakpoints
'
;
const
ModalStore
=
gl
.
issueBoards
.
ModalStore
;
const
ModalStore
=
gl
.
issueBoards
.
ModalStore
;
...
...
app/assets/javascripts/breakpoints.js
View file @
3fc89919
...
@@ -16,8 +16,4 @@ const BreakpointInstance = {
...
@@ -16,8 +16,4 @@ const BreakpointInstance = {
},
},
};
};
// For legacy reasons, this is added to window
// one day this should be deleted
window
.
bp
=
BreakpointInstance
;
export
default
BreakpointInstance
;
export
default
BreakpointInstance
;
app/assets/javascripts/build.js
View file @
3fc89919
/* eslint-disable func-names, wrap-iife, no-use-before-define,
/* eslint-disable func-names, wrap-iife, no-use-before-define,
consistent-return, prefer-rest-params */
consistent-return, prefer-rest-params */
/* global Breakpoints */
import
_
from
'
underscore
'
;
import
_
from
'
underscore
'
;
import
bp
from
'
./breakpoints
'
;
import
{
bytesToKiB
}
from
'
./lib/utils/number_utils
'
;
import
{
bytesToKiB
}
from
'
./lib/utils/number_utils
'
;
window
.
Build
=
(
function
()
{
window
.
Build
=
(
function
()
{
...
@@ -34,8 +33,6 @@ window.Build = (function () {
...
@@ -34,8 +33,6 @@ window.Build = (function () {
this
.
$scrollBottomBtn
=
$
(
'
.js-scroll-down
'
);
this
.
$scrollBottomBtn
=
$
(
'
.js-scroll-down
'
);
clearTimeout
(
Build
.
timeout
);
clearTimeout
(
Build
.
timeout
);
// Init breakpoint checker
this
.
bp
=
Breakpoints
.
get
();
this
.
initSidebar
();
this
.
initSidebar
();
this
.
populateJobs
(
this
.
buildStage
);
this
.
populateJobs
(
this
.
buildStage
);
...
@@ -230,7 +227,7 @@ window.Build = (function () {
...
@@ -230,7 +227,7 @@ window.Build = (function () {
};
};
Build
.
prototype
.
shouldHideSidebarForViewport
=
function
()
{
Build
.
prototype
.
shouldHideSidebarForViewport
=
function
()
{
const
bootstrapBreakpoint
=
this
.
bp
.
getBreakpointSize
();
const
bootstrapBreakpoint
=
bp
.
getBreakpointSize
();
return
bootstrapBreakpoint
===
'
xs
'
||
bootstrapBreakpoint
===
'
sm
'
;
return
bootstrapBreakpoint
===
'
xs
'
||
bootstrapBreakpoint
===
'
sm
'
;
};
};
...
...
app/assets/javascripts/fly_out_nav.js
View file @
3fc89919
/* global bp */
import
Cookies
from
'
js-cookie
'
;
import
Cookies
from
'
js-cookie
'
;
import
'
./breakpoints
'
;
import
bp
from
'
./breakpoints
'
;
export
const
canShowActiveSubItems
=
(
el
)
=>
{
export
const
canShowActiveSubItems
=
(
el
)
=>
{
const
isHiddenByMedia
=
bp
.
getBreakpointSize
()
===
'
sm
'
||
bp
.
getBreakpointSize
()
===
'
md
'
;
const
isHiddenByMedia
=
bp
.
getBreakpointSize
()
===
'
sm
'
||
bp
.
getBreakpointSize
()
===
'
md
'
;
...
...
app/assets/javascripts/issuable_context.js
View file @
3fc89919
/* eslint-disable func-names, space-before-function-paren, wrap-iife, no-new, comma-dangle, quotes, prefer-arrow-callback, consistent-return, one-var, no-var, one-var-declaration-per-line, no-underscore-dangle, max-len */
/* eslint-disable func-names, space-before-function-paren, wrap-iife, no-new, comma-dangle, quotes, prefer-arrow-callback, consistent-return, one-var, no-var, one-var-declaration-per-line, no-underscore-dangle, max-len */
/* global bp */
import
Cookies
from
'
js-cookie
'
;
import
Cookies
from
'
js-cookie
'
;
import
bp
from
'
./breakpoints
'
;
import
UsersSelect
from
'
./users_select
'
;
import
UsersSelect
from
'
./users_select
'
;
const
PARTICIPANTS_ROW_COUNT
=
7
;
const
PARTICIPANTS_ROW_COUNT
=
7
;
...
...
app/assets/javascripts/main.js
View file @
3fc89919
/* eslint-disable func-names, space-before-function-paren, no-var, quotes, consistent-return, prefer-arrow-callback, comma-dangle, object-shorthand, no-new, max-len, no-multi-spaces, import/newline-after-import, import/first */
/* eslint-disable func-names, space-before-function-paren, no-var, quotes, consistent-return, prefer-arrow-callback, comma-dangle, object-shorthand, no-new, max-len, no-multi-spaces, import/newline-after-import, import/first */
/* global bp */
/* global Flash */
/* global Flash */
/* global ConfirmDangerModal */
/* global ConfirmDangerModal */
/* global Aside */
/* global Aside */
...
@@ -66,7 +65,7 @@ import './api';
...
@@ -66,7 +65,7 @@ import './api';
import
'
./aside
'
;
import
'
./aside
'
;
import
'
./autosave
'
;
import
'
./autosave
'
;
import
loadAwardsHandler
from
'
./awards_handler
'
;
import
loadAwardsHandler
from
'
./awards_handler
'
;
import
'
./breakpoints
'
;
import
bp
from
'
./breakpoints
'
;
import
'
./broadcast_message
'
;
import
'
./broadcast_message
'
;
import
'
./build
'
;
import
'
./build
'
;
import
'
./build_artifacts
'
;
import
'
./build_artifacts
'
;
...
...
app/assets/javascripts/merge_request_tabs.js
View file @
3fc89919
/* eslint-disable no-new, class-methods-use-this */
/* eslint-disable no-new, class-methods-use-this */
/* global Breakpoints */
/* global Flash */
/* global Flash */
/* global notes */
/* global notes */
import
Cookies
from
'
js-cookie
'
;
import
Cookies
from
'
js-cookie
'
;
import
'
./breakpoints
'
;
import
'
./flash
'
;
import
'
./flash
'
;
import
BlobForkSuggestion
from
'
./blob/blob_fork_suggestion
'
;
import
BlobForkSuggestion
from
'
./blob/blob_fork_suggestion
'
;
import
initChangesDropdown
from
'
./init_changes_dropdown
'
;
import
initChangesDropdown
from
'
./init_changes_dropdown
'
;
import
bp
from
'
./breakpoints
'
;
/* eslint-disable max-len */
/* eslint-disable max-len */
// MergeRequestTabs
// MergeRequestTabs
...
@@ -134,7 +133,7 @@ import initChangesDropdown from './init_changes_dropdown';
...
@@ -134,7 +133,7 @@ import initChangesDropdown from './init_changes_dropdown';
this
.
destroyPipelinesView
();
this
.
destroyPipelinesView
();
}
else
if
(
this
.
isDiffAction
(
action
))
{
}
else
if
(
this
.
isDiffAction
(
action
))
{
this
.
loadDiff
(
$target
.
attr
(
'
href
'
));
this
.
loadDiff
(
$target
.
attr
(
'
href
'
));
if
(
Breakpoints
.
get
()
.
getBreakpointSize
()
!==
'
lg
'
)
{
if
(
bp
.
getBreakpointSize
()
!==
'
lg
'
)
{
this
.
shrinkView
();
this
.
shrinkView
();
}
}
if
(
this
.
diffViewType
()
===
'
parallel
'
)
{
if
(
this
.
diffViewType
()
===
'
parallel
'
)
{
...
@@ -145,7 +144,7 @@ import initChangesDropdown from './init_changes_dropdown';
...
@@ -145,7 +144,7 @@ import initChangesDropdown from './init_changes_dropdown';
this
.
resetViewContainer
();
this
.
resetViewContainer
();
this
.
mountPipelinesView
();
this
.
mountPipelinesView
();
}
else
{
}
else
{
if
(
Breakpoints
.
get
()
.
getBreakpointSize
()
!==
'
xs
'
)
{
if
(
bp
.
getBreakpointSize
()
!==
'
xs
'
)
{
this
.
expandView
();
this
.
expandView
();
}
}
this
.
resetViewContainer
();
this
.
resetViewContainer
();
...
@@ -392,7 +391,7 @@ import initChangesDropdown from './init_changes_dropdown';
...
@@ -392,7 +391,7 @@ import initChangesDropdown from './init_changes_dropdown';
// Screen space on small screens is usually very sparse
// Screen space on small screens is usually very sparse
// So we dont affix the tabs on these
// So we dont affix the tabs on these
if
(
Breakpoints
.
get
()
.
getBreakpointSize
()
===
'
xs
'
||
!
$tabs
.
length
)
return
;
if
(
bp
.
getBreakpointSize
()
===
'
xs
'
||
!
$tabs
.
length
)
return
;
/**
/**
If the browser does not support position sticky, it returns the position as static.
If the browser does not support position sticky, it returns the position as static.
...
...
app/assets/javascripts/monitoring/components/monitoring_column.vue
View file @
3fc89919
<
script
>
<
script
>
/* global Breakpoints */
import
d3
from
'
d3
'
;
import
d3
from
'
d3
'
;
import
monitoringLegends
from
'
./monitoring_legends.vue
'
;
import
monitoringLegends
from
'
./monitoring_legends.vue
'
;
import
monitoringFlag
from
'
./monitoring_flag.vue
'
;
import
monitoringFlag
from
'
./monitoring_flag.vue
'
;
...
@@ -8,6 +7,7 @@
...
@@ -8,6 +7,7 @@
import
eventHub
from
'
../event_hub
'
;
import
eventHub
from
'
../event_hub
'
;
import
measurements
from
'
../utils/measurements
'
;
import
measurements
from
'
../utils/measurements
'
;
import
{
formatRelevantDigits
}
from
'
../../lib/utils/number_utils
'
;
import
{
formatRelevantDigits
}
from
'
../../lib/utils/number_utils
'
;
import
bp
from
'
../../breakpoints
'
;
const
bisectDate
=
d3
.
bisector
(
d
=>
d
.
time
).
left
;
const
bisectDate
=
d3
.
bisector
(
d
=>
d
.
time
).
left
;
...
@@ -42,7 +42,6 @@
...
@@ -42,7 +42,6 @@
yScale
:
{},
yScale
:
{},
margin
:
{},
margin
:
{},
data
:
[],
data
:
[],
breakpointHandler
:
Breakpoints
.
get
(),
unitOfDisplay
:
''
,
unitOfDisplay
:
''
,
areaColorRgb
:
'
#8fbce8
'
,
areaColorRgb
:
'
#8fbce8
'
,
lineColorRgb
:
'
#1f78d1
'
,
lineColorRgb
:
'
#1f78d1
'
,
...
@@ -96,7 +95,7 @@
...
@@ -96,7 +95,7 @@
methods
:
{
methods
:
{
draw
()
{
draw
()
{
const
breakpointSize
=
this
.
breakpointHandler
.
getBreakpointSize
();
const
breakpointSize
=
bp
.
getBreakpointSize
();
const
query
=
this
.
columnData
.
queries
[
0
];
const
query
=
this
.
columnData
.
queries
[
0
];
this
.
margin
=
measurements
.
large
.
margin
;
this
.
margin
=
measurements
.
large
.
margin
;
if
(
breakpointSize
===
'
xs
'
||
breakpointSize
===
'
sm
'
)
{
if
(
breakpointSize
===
'
xs
'
||
breakpointSize
===
'
sm
'
)
{
...
...
app/assets/javascripts/new_sidebar.js
View file @
3fc89919
import
Cookies
from
'
js-cookie
'
;
import
Cookies
from
'
js-cookie
'
;
import
_
from
'
underscore
'
;
import
_
from
'
underscore
'
;
/* global bp */
import
bp
from
'
./breakpoints
'
;
import
'
./breakpoints
'
;
export
default
class
NewNavSidebar
{
export
default
class
NewNavSidebar
{
constructor
()
{
constructor
()
{
...
...
app/assets/javascripts/wikis.js
View file @
3fc89919
/* global Breakpoints */
import
bp
from
'
./breakpoints
'
;
import
'
./breakpoints
'
;
export
default
class
Wikis
{
export
default
class
Wikis
{
constructor
()
{
constructor
()
{
this
.
bp
=
Breakpoints
.
get
();
this
.
sidebarEl
=
document
.
querySelector
(
'
.js-wiki-sidebar
'
);
this
.
sidebarEl
=
document
.
querySelector
(
'
.js-wiki-sidebar
'
);
this
.
sidebarExpanded
=
false
;
this
.
sidebarExpanded
=
false
;
...
@@ -41,15 +38,15 @@ export default class Wikis {
...
@@ -41,15 +38,15 @@ export default class Wikis {
this
.
renderSidebar
();
this
.
renderSidebar
();
}
}
sidebarCanCollapse
()
{
s
tatic
s
idebarCanCollapse
()
{
const
bootstrapBreakpoint
=
this
.
bp
.
getBreakpointSize
();
const
bootstrapBreakpoint
=
bp
.
getBreakpointSize
();
return
bootstrapBreakpoint
===
'
xs
'
||
bootstrapBreakpoint
===
'
sm
'
;
return
bootstrapBreakpoint
===
'
xs
'
||
bootstrapBreakpoint
===
'
sm
'
;
}
}
renderSidebar
()
{
renderSidebar
()
{
if
(
!
this
.
sidebarEl
)
return
;
if
(
!
this
.
sidebarEl
)
return
;
const
{
classList
}
=
this
.
sidebarEl
;
const
{
classList
}
=
this
.
sidebarEl
;
if
(
this
.
sidebarExpanded
||
!
th
is
.
sidebarCanCollapse
())
{
if
(
this
.
sidebarExpanded
||
!
Wik
is
.
sidebarCanCollapse
())
{
if
(
!
classList
.
contains
(
'
right-sidebar-expanded
'
))
{
if
(
!
classList
.
contains
(
'
right-sidebar-expanded
'
))
{
classList
.
remove
(
'
right-sidebar-collapsed
'
);
classList
.
remove
(
'
right-sidebar-collapsed
'
);
classList
.
add
(
'
right-sidebar-expanded
'
);
classList
.
add
(
'
right-sidebar-expanded
'
);
...
...
spec/javascripts/fly_out_nav_spec.js
View file @
3fc89919
/* global bp */
import
Cookies
from
'
js-cookie
'
;
import
Cookies
from
'
js-cookie
'
;
import
{
import
{
calculateTop
,
calculateTop
,
...
@@ -7,6 +6,7 @@ import {
...
@@ -7,6 +6,7 @@ import {
canShowSubItems
,
canShowSubItems
,
canShowActiveSubItems
,
canShowActiveSubItems
,
}
from
'
~/fly_out_nav
'
;
}
from
'
~/fly_out_nav
'
;
import
bp
from
'
~/breakpoints
'
;
describe
(
'
Fly out sidebar navigation
'
,
()
=>
{
describe
(
'
Fly out sidebar navigation
'
,
()
=>
{
let
el
;
let
el
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment