Skip to content

Commit

Permalink
Merge pull request #49 from kaaass/master
Browse files Browse the repository at this point in the history
增加了点击项目时浏览器地址栏、标题的变化
  • Loading branch information
star7th committed Apr 13, 2016
2 parents 647c07a + 6026b41 commit b883116
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
14 changes: 7 additions & 7 deletions Application/Home/View/Index/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,21 @@ <h3 class="muted">ShowDoc</h3>
</ol>
<!-- 轮播(Carousel)项目 -->
<div class="carousel-inner">
<!-- <div class="item active">
<img src="__PUBLIC__/img/pic1.jpg" alt="First slide">
</div> -->
<div class="item active">
<img src="__PUBLIC__/img/pic1.jpg" alt="First slide">
</div>
<div class="item">
<img src="__PUBLIC__/img/pic2.jpg" alt="Second slide">
</div>
<!-- <div class="item">
<div class="item">
<img src="__PUBLIC__/img/pic3.jpg" alt="Third slide">
</div> -->
</div>
</div>
<!-- 轮播(Carousel)导航 -->
<!-- <a class="carousel-control left" href="#myCarousel"
<a class="carousel-control left" href="#myCarousel"
data-slide="prev">&lsaquo;</a>
<a class="carousel-control right" href="#myCarousel"
data-slide="next">&rsaquo;</a> -->
data-slide="next">&rsaquo;</a>
</div>
<!-- <p class="lead " >
<small>
Expand Down
6 changes: 5 additions & 1 deletion Public/js/item/show.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

//页面加载完就执行
$(function(){

Expand Down Expand Up @@ -101,7 +100,11 @@ $(function(){
};
//获取对应的page_id
page_id = $(this).children("a").attr("data-page-id");
page_title = $(this).children("a")[0].innerText;
if (page_id != '' && page_id != null && page_id !='#') {
if (page_title != '' && page_title != null) {
document.title = page_title + " - ShowDoc";
}
change_page(page_id);
//如果是移动设备的话,则滚动页面
if( isMobile()){
Expand All @@ -122,6 +125,7 @@ $(function(){
$("#copy-link").attr("href" , base_url+"/Home/page/edit?item_id="+item_id+"&copy_page_id="+page_id);
$("#share-page-link").html("http://"+window.location.host+base_url+"/"+item_id+"?page_id="+page_id);
$("#delete-link").attr("href" , base_url+"/Home/page/delete?page_id="+page_id);
history.replaceState(null, null, "http://"+window.location.host+base_url+"/"+item_id+"?page_id="+page_id);
}

//分享项目
Expand Down

0 comments on commit b883116

Please sign in to comment.