diff --git a/public/assets/wechat/activities.html b/public/assets/wechat/activities.html index 130898051..c99c9ee09 100644 --- a/public/assets/wechat/activities.html +++ b/public/assets/wechat/activities.html @@ -111,7 +111,7 @@ 状态:{{act.issue_detail.issue_status}} 优先级:{{act.issue_detail.issue_priority}}
指派给:{{act.issue_detail.issue_assigned_to}} 完成度:{{act.issue_detail.done_ratio}}% - 点击展开 + 点击展开
{{act.latest_update}}
diff --git a/public/javascripts/wechat/app.js b/public/javascripts/wechat/app.js index 6c8d79c48..5e6234501 100644 --- a/public/javascripts/wechat/app.js +++ b/public/javascripts/wechat/app.js @@ -3,19 +3,19 @@ var apiUrl = 'http://wechat.trustie.net/api/v1/'; var debug = true; //调试标志,如果在本地请置为true if(debug===true){ - apiUrl = 'http://localhost:3000/api/v1/'; + //apiUrl = 'http://localhost:3000/api/v1/'; } app.factory('auth', function($http,$routeParams, $cookies, $q){ var _openid = ''; if(debug===true){ - _openid = "2"; + _openid = "oCnvgvz8R7QheXE-R9Kkr39j8Ndg"; } var getOpenId = function() { var deferred = $q.defer(); - if (typeof _openid !== 'undefined' && _openid.length > 0) { + if (typeof _openid !== 'undefined' && _openid.length > 0){ deferred.resolve(_openid); } else { var code = $routeParams.code; @@ -289,6 +289,38 @@ app.filter('safeHtml', function ($sce) { } }); +app.directive('textAutoHeight', function($timeout){ + return { + restrict: 'A', + scope: {}, + link: function(scope, element, attr){ + scope.text = '点击展开'; + $timeout(function(){ + var e = element.parent().children().eq(4); + var height = e[0].scrollHeight; + var offsetHeight = e[0].offsetHeight; + console.log(height); + console.log(offsetHeight); + console.log(attr); + if(height>90){ + element.css('display', 'block'); + element.on('click', function(){ + if(element.text() == "点击展开"){ + e.css("height", height+'px'); + element.text("点击隐藏"); + } else { + e.css("height", '90px'); + element.text("点击展开"); + } + + }); + } + }, false); + + } + } +}); + app.config(['$routeProvider',function ($routeProvider) { $routeProvider .when('/activities', {