Skip to content

Commit

Permalink
例行上线9.6 (#255)
Browse files Browse the repository at this point in the history
  • Loading branch information
easonyq authored Sep 6, 2018
1 parent a454ae2 commit 604403c
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/mip/src/components/mip-shell/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class MipShell extends CustomElement {
this.ignoreWarning = tmpShellConfig.ignoreWarning
}
if (!tmpShellConfig.routes) {
!this.ignoreWarning && this.console.warn('检测到 MIP Shell 配置没有包含 `routes` 数组,MIP 将自动生成一条默认的路由配置。')
!this.ignoreWarning && console.warn('检测到 MIP Shell 配置没有包含 `routes` 数组,MIP 将自动生成一条默认的路由配置。')
tmpShellConfig.routes = [{
pattern: '*',
meta: DEFAULT_SHELL_CONFIG
Expand Down
10 changes: 8 additions & 2 deletions packages/mip/src/page/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,15 @@ class Page {
return
}

const hashContent = hash.slice(1)

try {
const anchor = document.getElementById(hash.slice(1)) ||
document.getElementById(decodeURIComponent(hash.slice(1)))
/**
* @see {@link http://w3c.github.io/html/browsers.html#navigating-to-a-fragment-identifier}
*/
const anchor = document.getElementById(hashContent) ||
document.getElementById(decodeURIComponent(hashContent)) ||
document.querySelector(`a[name="${hashContent}"]`)

/* istanbul ignore next */
if (anchor) {
Expand Down
2 changes: 1 addition & 1 deletion packages/mip/src/page/util/dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ export function ensureMIPShell () {
let shell = document.createElement('mip-shell')
let script = document.createElement('script')
script.setAttribute('type', 'application/json')
script.innerHTML = '{}'
script.innerHTML = '{"ignoreWarning": true}'
shell.appendChild(script)
document.body.appendChild(shell)
}
Expand Down
1 change: 1 addition & 0 deletions packages/mip/src/styles/mip-base.less
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ body {
font: 14px Arial, Helvetica, sans-serif;
box-sizing: border-box;
-webkit-box-sizing: border-box;
overflow-x: hidden;
&.with-header {
padding-top: @shell-header-height;
}
Expand Down
4 changes: 2 additions & 2 deletions packages/mip/src/styles/mip-page.less
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ body.with-header {
.mip-page-fade-header-wrapper {
top: 0;
left: 0;
right: 95px;
right: 47px;
height: @shell-header-height;
background: #fff;
z-index: 20001 !important;
Expand All @@ -118,7 +118,7 @@ body.with-header {
opacity: 1;
}
.mip-shell-header {
padding-left: 95px;
padding-left: 47px;
padding-right: 0;
}
}
18 changes: 17 additions & 1 deletion packages/mip/src/styles/mip-shell.less
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,25 @@ mip-shell * {
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
max-width: 100%;
// max-width: 250px;
max-width: 212px;

@media screen and (max-width: 375px) {
& {
// max-width: 210px;
max-width: 172px;
}
}

@media screen and (max-width: 320px) {
& {
// max-width: 130px;
max-width: 92px;
}
}
}
}

.mip-shell-header-button-group {
width: 87px;
height: 30px;
Expand Down

0 comments on commit 604403c

Please sign in to comment.